Created
August 9, 2009 15:54
-
-
Save methodmissing/164801 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 -Zs | |
| /* | |
| sudo dtrace -Zs walk.d -c 'ruby test.rb' | |
| */ | |
| #pragma D option quiet | |
| #pragma D option switchrate=10 | |
| #pragma D option dynvarsize=128m | |
| #pragma D option bufsize=128m | |
| #pragma D option aggsize=64m | |
| self int depth; | |
| self int rb_in_eval; | |
| dtrace:::BEGIN | |
| { | |
| self->depth = 0; | |
| self->rb_in_eval = 0; | |
| printf("Walking MRI 18 eval ...") | |
| } | |
| pid$target::rb_eval:entry{ | |
| self->rb_in_eval = 1; | |
| } | |
| pid$target:::return | |
| /self->rb_in_eval/ | |
| { | |
| printf( "%*s-> %s()\n", self->depth * 2, "", probefunc ); | |
| self->depth++; | |
| } | |
| pid$target:::return | |
| /self->rb_in_eval/ | |
| { | |
| self->depth--; | |
| printf( "%*s<- %s()\n", self->depth * 2, "", probefunc ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment