Static probes are being gradually integrated into MySQL. As of MySQL
6.0.9, there are around 55 static probes. To use the static probes, you
will have to supply an extra option to the configure script, --enable-dtrace. After the build is over, start mysqld. Now open a terminal, and type $pfexec dtrace -l | grep mysql. You should see something like this:
135 mysql23509 mysqld __1cQdispatch_command6FnTenum_server_command_pnDTHD_pcI_b_ command-done 136 mysql23509 mysqld __1cQdispatch_command6FnTenum_server_command_pnDTHD_pcI_b_ command-start 137 mysql23509 mysqld __1cQclose_connection6FpnDTHD_Ib_v_ connection-done 138 mysql23509 mysqld handle_one_connection connection-start 139 mysql23509 mysqld __1cMmysql_delete6FpnDTHD_pnKTABLE_LIST_pnEItem_pnLst_sql_list_LXb_b_ delete-done 140 mysql23509 mysqld __1cHhandlerNha_delete_row6MpkC_i_ delete-row-done . .
As is expected, the function names are mangled. You can view the demangled names with 'dem':
$pfexec dtrace -l | grep mysql | awk '{print $4}' | xargs dem | awk '{print $4}'
which you will show the demangled functions:
handler::ha_external_lock(THD*,int) handler::ha_external_lock(THD*,int) handler::ha_external_lock(THD*,int) handler::ha_external_lock(THD*,int) handler::ha_external_lock(THD*,int) handler::ha_external_lock(THD*,int) mysql_insert(THD*,TABLE_LIST*,List<Item>&,List<List<Item> handler::ha_write_row(unsigned handler::ha_write_row(unsigned select_insert::abort() select_insert::send_eof() mysql_execute_command(THD*) mysql_execute_command(THD*) multi_delete::send_data(List<Item>&) mysql_execute_command(THD*) multi_update::send_data(List<Item>&) mysql_execute_command(THD*) . . . handle_select(THD*,LEX*,select_result*,unsigned handle_select(THD*,LEX*,select_result*,unsigned multi_update::send_data(List<Item>&) mysql_update(THD*,TABLE_LIST*,List<Item>&,List<Item>&,Item*,unsigned,st_order*,unsigned handler::ha_update_row(const handler::ha_update_row(const mysql_execute_command(THD*)



You can also just pipe the output to c++filt (/bin/c++filt on my opensolaris box and part of sun studio) and it does the same thing
pfexec dtrace -l | grep mysql |c++filt
Posted by Neelakanth Nadgir on February 24, 2009 at 03:49 AM IST #
Thank You Neel. Yes, I saw 'c++filt', but just went ahead with 'dem'. Thanks, again.
Posted by Amit on February 24, 2009 at 08:37 AM IST #