Created
October 17, 2008 20:42
-
-
Save marcus/17521 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Create a file called trace_sqllog with the following | |
#!/usr/sbin/dtrace -qs | |
pid$1::*dispatch_command*:entry | |
{ | |
printf("%d::%s\n",tid,copyinstr(arg2)); | |
} | |
## Taken from http://blogs.sun.com/angelo/entry/observing_mysql_sql_statements_in | |
## Add the following to your ~/.bash_profile | |
pidof () { ps -Ac | egrep $@ | awk '{print $1}'; } | |
alias sqllog='sudo ~/trace_sqllog `pidof mysqld`' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment