DTrace is a comprehensive dynamic tracing framework for  the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers,  and  service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.

Recently we enabled dtrace support for MySQL 5.1 for OpenSolaris.Here I list the way dtrace support needs to be enabled and the testing that needs to follow to check the dtrace functionality .

  • Add --enable-dtrace flag as configure option for 32 bit compilation in the Makefile
  • Add --enable-dtrace DTRACEFLAGS="-64" for 64 bit compilation in the Makefile


After the package is built and installed ,test dtrace functionality as follows.

As root
1)#dtrace -l | grep mysql

This should give you complete listing of the dtrace probes that are supported by the MySQL patch.
Example

17727 mysql24788            mysqld __1cNsp_instr_stmtJexec_core6MpnDTHD_pI_i_ query_execute_start
17728 mysql24788            mysqld __1cVexecute_sqlcom_select6FpnDTHD_pnKTABLE_LIST__b_ select_end
17729 mysql24788            mysqld __1cVexecute_sqlcom_select6FpnDTHD_pnKTABLE_LIST__b_ select_start
17730 mysql24788            mysqld __1cVmysql_execute_command6FpnDTHD__i_ update_end
17731 mysql24788            mysqld __1cHhandlerNha_update_row6MpkCpC_i_ update_row_end
17732 mysql24788            mysqld __1cHhandlerNha_update_row6MpkCpC_i_ update_row_start
17733 mysql24788            mysqld __1cVmysql_execute_command6FpnDTHD__i_ update_start

2) dtrace -n mysql24788:mysqld:__1cVexecute_sqlcom_select6FpnDTHD_pnKTABLE_LIST__b_:select_start

Do a ^C here ,it says matched 1probe ...

3) Run step 2 again and while running step 2 again ,open another session ,connect to database and execute any select statement ,you should see the dtrace count increasing ...

Example :

A simple select statement will look like this 
mysql> select User,Host,Password from user; 

Hope this helps beginners with dtrace .

Comments:

Hi Sunanda,

After configuring the MySQL 5.1/26-rc sources with '--enable-dtrace' flag and installing it, 'dtrace -l | grep mysql' returns no results.

What is wrong?

Posted by Amit Saha on September 01, 2008 at 05:25 AM PDT #

Can you please Give step by step methodology to install MySQL on opensolaris with dtrace option being enabled.

I have already installed mysql on my opensolaris box,but without dtrace being enabled & I am currently searching for a proper procedure to enable dtrace option.

I had built the mysql from the source using a tarball & I am not finding the makefile anywhere after installing it now.

I am a newbie to solaris.Can you please help me to come out of this problem.

Thanks in advance.

Posted by vijay on March 03, 2009 at 05:31 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Sunanda Menon