Created
January 22, 2019 21:26
-
-
Save misha354/f82ca3ddb91b050148496f539c8a36cc 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
/* | |
Based on Brendan Gregg's work: http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html | |
*/ | |
global s; | |
global quit = 0; | |
probe timer.profile { | |
if (pid() == target()) { | |
if (quit) { | |
foreach (i in s-) { | |
print_stack(i); | |
printf("\t%d\n", @count(s[i])); | |
} | |
exit() | |
} else { | |
s[ubacktrace()] <<< 1; | |
} | |
} | |
} | |
probe timer.s(20) { | |
quit = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment