Skip to content

Instantly share code, notes, and snippets.

@albertnetymk
Last active November 12, 2015 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertnetymk/409669360134f0b3b2a7 to your computer and use it in GitHub Desktop.
Save albertnetymk/409669360134f0b3b2a7 to your computer and use it in GitHub Desktop.
global gc_major
global gc_minor
global gc_major_count
global gc_minor_count
global stat
global count_stat
probe process("/home/albert/github/otp/bin/x86_64-unknown-linux-gnu/beam.smp").mark("gc_major__start")
{
gc_major[user_string($arg1)] = gettimeofday_ms() - gc_major[user_string($arg1)]
}
probe process("/home/albert/github/otp/bin/x86_64-unknown-linux-gnu/beam.smp").mark("gc_major__end")
{
gc_major[user_string($arg1)] = gettimeofday_ms() - gc_major[user_string($arg1)]
gc_major_count[user_string($arg1)]++
}
probe process("/home/albert/github/otp/bin/x86_64-unknown-linux-gnu/beam.smp").mark("gc_minor__start")
{
gc_minor[user_string($arg1)] = gettimeofday_ms() - gc_minor[user_string($arg1)]
}
probe process("/home/albert/github/otp/bin/x86_64-unknown-linux-gnu/beam.smp").mark("gc_minor__end")
{
gc_minor[user_string($arg1)] = gettimeofday_ms() - gc_minor[user_string($arg1)]
gc_minor_count[user_string($arg1)]++
}
probe end
{
foreach(x in gc_major) {
stat <<< gc_major[x]
}
foreach(x in gc_major_count) {
count_stat <<< gc_major_count[x]
}
printf("gc_major: sum:%d num:%d\n", @sum(stat), @sum(count_stat))
delete stat
delete count_stat
foreach(x in gc_minor) {
stat <<< gc_minor[x]
}
foreach(x in gc_minor_count) {
count_stat <<< gc_minor_count[x]
}
printf("gc_minor: sum:%d num:%d\n", @sum(stat), @sum(count_stat))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment