~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/probes.d

  • Committer: Monty Taylor
  • Date: 2008-11-16 05:36:13 UTC
  • mto: (584.1.9 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116053613-bld4rqxhlkb49c02
Split out cache_row and type_holder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
/*
21
 
  The actual probe names in DTrace scripts will replace '__' by '-'. Thus
22
 
  insert__row__start will be insert-row-start.
23
 
 
24
 
  Recommendations for adding new probes:
25
 
 
26
 
  - each probe should have the minimal set of arguments required to
27
 
  unambiguously identify the context in which the probe fires. Redundant
28
 
  probes (i.e. the ones that can be obtained in user scripts from previous
29
 
  probes' arguments or otherwise) may be added for convenience.
30
 
 
31
 
  - try to avoid computationally expensive probe arguments. If impossible,
32
 
  use *_ENABLED() macros to check if the probe is activated before
33
 
  performing expensive calculations for a probe argument.
34
 
 
35
 
  - all *-done probes should have a status argument wherever applicable to make
36
 
  it possible for user scripts to figure out whether the completed operation
37
 
  was successful or not.
38
 
  
39
 
  - for all status arguments, a non-zero value should be returned on error or
40
 
  failure, 0 should be returned on success.
41
 
*/
42
 
 
43
20
provider drizzle {
44
 
  
45
 
  /* The following ones fire when creating or closing a client connection */
46
 
  probe connection__start(unsigned long conn_id);
47
 
  probe connection__done(unsigned long conn_id);
48
 
 
49
 
  /*
50
 
   * Fire at the start/end of any client command processing (including SQL
51
 
   * queries).
52
 
  */
53
 
  probe command__start(unsigned long conn_id, int command);
54
 
  probe command__done(int status);
55
 
  
56
 
  /*
57
 
   * The following probes fire at the start/end of any SQL query processing,
58
 
   * respectively.
59
 
   *
60
 
   * query_start() has a lot of parameters that can be used to pick up
61
 
   * parameters for a lot of other probes here.  For simplicity reasons we also
62
 
   * add the query string to most other DTrace probes as well. Hostname is
63
 
   * either the hostname or the IP address of the Drizzle client.
64
 
   */
65
 
  probe query__start(const char *query,
66
 
                     unsigned long conn_id,
67
 
                     const char *db_name);
68
 
  probe query__done(int status); 
69
 
 
70
 
  /* Fire at the start/end of SQL query parsing */
71
 
  probe query__parse__start(const char *query);
72
 
  probe query__parse__done(int status);
73
 
 
74
 
  /*
75
 
   * This probe fires when the actual query execution starts
76
 
   */
77
 
  probe query__exec__start(const char *query,
78
 
                           unsigned long connid,
79
 
                           const char *db_name);
80
 
  probe query__exec__done(int status);
81
 
 
82
 
  /*
83
 
   * These probes fire in the query optimizer
84
 
   */
85
 
  probe query__opt__start(const char *query,
86
 
                          unsigned long connid);
87
 
  probe query__opt__done(int status);
88
 
  probe query__opt__choose__plan__start(const char *query,
89
 
                                        unsigned long connid);
90
 
  probe query__opt__choose__plan__done(int status);
91
 
 
92
 
  /* These probes fire when performing write operations towards any Cursor */
93
 
  probe insert__row__start(const char *db, const char *table);
94
 
  probe insert__row__done(int status);
95
 
  probe update__row__start(const char *db, const char *table);
96
 
  probe update__row__done(int status);
97
 
  probe delete__row__start(const char *db, const char *table);
98
 
  probe delete__row__done(int status);
99
 
 
100
 
  /*
101
 
   * These probes fire when calling external_lock for any Cursor 
102
 
   * depending on the lock type being acquired or released.
103
 
   */
104
 
  probe cursor__rdlock__start(const char *db, const char *table);
105
 
  probe cursor__wrlock__start(const char *db, const char *table);
106
 
  probe cursor__unlock__start(const char *db, const char *table);
107
 
  probe cursor__rdlock__done(int status);
108
 
  probe cursor__wrlock__done(int status);
109
 
  probe cursor__unlock__done(int status);
110
 
  
111
 
  /*
112
 
   * These probes fire when a filesort activity happens in a query.
113
 
   */
114
 
  probe filesort__start(const char *db, const char *table);
115
 
  probe filesort__done(int status, unsigned long rows);
116
 
  /*
117
 
   * The query types SELECT, INSERT, INSERT AS SELECT, UPDATE, DELETE
118
 
   * are all probed.
119
 
   * The start probe always contains the query text.
120
 
   */
121
 
  probe select__start(const char *query);
122
 
  probe select__done(int status, unsigned long rows);
123
 
  probe insert__start(const char *query);
124
 
  probe insert__done(int status, unsigned long rows);
125
 
  probe insert__select__start(const char *query);
126
 
  probe insert__select__done(int status, unsigned long rows);
127
 
  probe update__start(const char *query);
128
 
  probe update__done(int status,
129
 
                     unsigned long rowsmatches, unsigned long rowschanged);
130
 
  probe delete__start(const char *query);
131
 
  probe delete__done(int status, unsigned long rows);
132
 
 
 
21
probe external_lock(int);
 
22
probe insert_row_start();
 
23
probe insert_row_end();
 
24
probe filesort_start();
 
25
probe filesort_end();
 
26
probe delete_start();
 
27
probe delete_end();
 
28
probe insert_start();
 
29
probe insert_end();
 
30
probe select_start();
 
31
probe select_end();
 
32
probe update_start();
 
33
probe update_end();
133
34
};