Skip to content

Instantly share code, notes, and snippets.

@kshimo69
Created February 9, 2012 10:06
Show Gist options
  • Save kshimo69/1779005 to your computer and use it in GitHub Desktop.
Save kshimo69/1779005 to your computer and use it in GitHub Desktop.
systemtapで関数1個調べる雛型
#!/usr/bin/stap
# usage: stap -vvv func.stp 'kernel.function("end_buffer_async_read")'
probe begin {
printf("\n")
}
probe $1 {
printf("%s %s() called pid=%d, pname=%s\n", ctime(gettimeofday_s()+32400), probefunc(), pid(), execname())
printf("vars: %s\n", $$vars)
printf("locals: %s\n", $$locals)
printf("\n")
}
probe $1.return {
printf("%s %s() leave pid=%d, pname=%s, return=%s\n", ctime(gettimeofday_s()+32400), probefunc(), pid(), execname(), $$return)
printf("vars: %s\n", $$vars)
printf("locals: %s\n", $$locals)
printf("\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment