Created
September 14, 2017 22:36
-
-
Save misterdjules/00f02f3423d17a30e4e5773ebb73d65d to your computer and use it in GitHub Desktop.
This file contains 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 | |
bunyan*:::log-debug | |
/json(copyinstr(arg0), "msg") == "pinging moray..."/ | |
{ | |
this->profiling_enabled = 1; | |
} | |
profile-997 | |
/pid == 21884 && this->profiling_enabled == 1/ | |
{ | |
@stacks[jstack(150, 8000)] = count(); | |
} | |
bunyan*:::log-debug | |
/json(copyinstr(arg0), "msg") == "successfully pinged moray"/ | |
{ | |
this->profiling_enabled = 0; | |
clear(@stacks); | |
} | |
bunyan*:::log-debug | |
/json(copyinstr(arg0), "msg") == "moray ping error"/ | |
{ | |
printf("Error!\n"); | |
this->profiling_enabled = 0; | |
printa(@stacks); | |
clear(@stacks); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment