~drizzle-trunk/drizzle/development

390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
4
 *  Copyright (C) 2009 Sun Microsystems
390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; version 2 of the License.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 */
1 by brian
clean slate
19
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
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
520.4.42 by mordred
Some updates to dtrace support.
43
provider drizzle {
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
44
  
45
  /* The following ones fire when creating or closing a client connection */
1126.10.3 by Padraig O'Sullivan
Updating the dtrace probes to be compatible with drizzle.
46
  probe connection__start(unsigned long conn_id);
1126.10.5 by Padraig O'Sullivan
Updated the connection start probe and re-generated the dtrace header file.
47
  probe connection__done(unsigned long conn_id);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
48
49
  /*
50
   * Fire at the start/end of any client command processing (including SQL
51
   * queries).
52
  */
1126.10.3 by Padraig O'Sullivan
Updating the dtrace probes to be compatible with drizzle.
53
  probe command__start(unsigned long conn_id, int command);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
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
   */
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
65
  probe query__start(const char *query,
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
66
                     unsigned long conn_id,
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
67
                     const char *db_name);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
68
  probe query__done(int status); 
69
70
  /* Fire at the start/end of SQL query parsing */
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
71
  probe query__parse__start(const char *query);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
72
  probe query__parse__done(int status);
73
74
  /*
1126.10.14 by Padraig O'Sullivan
Added calls to the query execution start/end dtrace probes.
75
   * This probe fires when the actual query execution starts
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
76
   */
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
77
  probe query__exec__start(const char *query,
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
78
                           unsigned long connid,
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
79
                           const char *db_name);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
80
  probe query__exec__done(int status);
81
1241.7.6 by Padraig O'Sullivan
Added some dtrace probes for tracing the optimizer.
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
1241.7.4 by Padraig O'Sullivan
Inserted calls to the cursor related probes that fire on inserts, updates, and deletes.
92
  /* These probes fire when performing write operations towards any Cursor */
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
93
  probe insert__row__start(const char *db, const char *table);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
94
  probe insert__row__done(int status);
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
95
  probe update__row__start(const char *db, const char *table);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
96
  probe update__row__done(int status);
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
97
  probe delete__row__start(const char *db, const char *table);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
98
  probe delete__row__done(int status);
99
100
  /*
1241.7.4 by Padraig O'Sullivan
Inserted calls to the cursor related probes that fire on inserts, updates, and deletes.
101
   * These probes fire when calling external_lock for any Cursor 
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
102
   * depending on the lock type being acquired or released.
103
   */
1241.7.4 by Padraig O'Sullivan
Inserted calls to the cursor related probes that fire on inserts, updates, and deletes.
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);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
110
  
111
  /*
112
   * These probes fire when a filesort activity happens in a query.
113
   */
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
114
  probe filesort__start(const char *db, const char *table);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
115
  probe filesort__done(int status, unsigned long rows);
116
  /*
1126.10.10 by Padraig O'Sullivan
Deleted the multi-delete dtrace probe as we don't have that in drizzle.
117
   * The query types SELECT, INSERT, INSERT AS SELECT, UPDATE, DELETE
118
   * are all probed.
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
119
   * The start probe always contains the query text.
120
   */
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
121
  probe select__start(const char *query);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
122
  probe select__done(int status, unsigned long rows);
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
123
  probe insert__start(const char *query);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
124
  probe insert__done(int status, unsigned long rows);
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
125
  probe insert__select__start(const char *query);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
126
  probe insert__select__done(int status, unsigned long rows);
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
127
  probe update__start(const char *query);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
128
  probe update__done(int status,
129
                     unsigned long rowsmatches, unsigned long rowschanged);
1126.10.24 by Padraig O'Sullivan
Updated the char * arguments to the dtrace probes to be const and also added
130
  probe delete__start(const char *query);
1126.10.1 by Padraig O'Sullivan
Added various dtrace probes that I ported from MySQL 6.0 to the list of
131
  probe delete__done(int status, unsigned long rows);
132
1 by brian
clean slate
133
};