mysql dtrace provider now enabled in MySQL 5.4
Over the last year there has been alot of work done to instrument MySQL with static dtrace probes. The mysql provider first became available in MySQL 6.0.8 but required a build with the --enable-dtrace flag to enable it. Starting with MySQL 5.4 the mysql provider and it's static probes are now enabled by default and ready to be used on Solaris 10, OpenSolaris and Mac OS X.
The static probes in MySQL 5.4 have been designed to follow the execution path of a query

with the level getting deeper as the query execution proceeds. However the probes are implemented so that you don't have to traverse the entire hierarchy to get the information you want.
They are also implemented in sets. The -start probe exposes pertinent information such as the query text. The -done probe returns the status of the probe operation. With probe sets time spent within an operation can be captured.
Check out MC Brown's MySQL University presentation "Using DTrace with MySQL" for details. MC and I will also be presenting a simlar presentation at the MySQL User's Conference on Tuesday 4/21 at 4:25pm (shameless plug). If you can't make that session there is another session on DTrace and MySQL on Wed 4/22 at 4:25pm.
For examples and ideas check out Jenny Chen's Blueprint on DTrace and MySQL . There is also a detailed section in the MySQL 6.0 documentation on using the MySQL static probes.
Please note the dtrace probes are also already available in the MySQL 5.1 included in OpenSolaris Web Stack (as well as upcoming Web Stack for S10). OpenSolaris has MySQL 5.1 (w/dtrace support) starting in build 111.
Posted by Jyri Virkki on April 21, 2009 at 11:03 AM PDT #
Posted by c0t0d0s0.org on April 22, 2009 at 05:13 AM PDT #