Created
February 26, 2015 18:11
-
-
Save cmittendorf/4d8d40c214a8b45b411c to your computer and use it in GitHub Desktop.
A dtrace script for tracing all SQL queries a mysql server is executing. Call this script using `sudo ./trace_all_queries.d -p `pgrep mysqld`.
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
#!/usr/sbin/dtrace -s | |
#pragma D option quiet | |
pid$target:mysqld:*mysql_parse*:entry | |
{ | |
printf("[%Y] %s\n", walltimestamp, copyinstr(arg1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment