-
-
Save agentzh/71336f0550bb2eca5786a4431bb2c340 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
global count = 0 | |
global bts | |
global target_pids | |
probe begin { | |
warn("Start tracing") | |
} | |
probe process("/bin/sleep").begin { | |
target_pids[pid()] = 1; | |
} | |
probe process("/bin/sleep").end { | |
delete target_pids[pid()]; | |
} | |
probe timer.profile { | |
if (!target_pids[pid()]) | |
next; | |
bt = sprint_ubacktrace() | |
if (bt == "") | |
next; | |
bts[bt] <<< 1; | |
if (++count >= 1000) { | |
abort(); | |
} | |
} | |
probe timer.s(3) { | |
abort() | |
} | |
probe end { | |
n = 0 | |
foreach (bt in bts- limit 900) { | |
n += strlen(bt) | |
} | |
println("n = ", n) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment