Created
November 20, 2012 12:34
-
-
Save Watson1978/4117667 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 -s | |
#pragma D option quiet | |
BEGIN | |
{ | |
printf("Target pid: %d\n\n", $target); | |
} | |
macruby$target:::method-entry | |
{ | |
/* printf("%30s:%-5d %s#%s\n", copyinstr(arg2), arg3, | |
copyinstr(arg0), copyinstr(arg1)); | |
*/ | |
@methods_count[copyinstr(arg0), copyinstr(arg1)] = count(); | |
} | |
END | |
{ | |
printf("\n"); | |
printf("%30s %-30s %s\n", "CLASS", "METHOD", "COUNT"); | |
printf("--------------------------------------------------------------------------------\n"); | |
printa("%30s %-30s %@d\n", @methods_count); | |
} |
Author
Watson1978
commented
Nov 20, 2012
MacRuby と同じ DTrace のプローブを使うことができます。
https://github.com/MacRuby/MacRuby/wiki/Using-DTrace
アプリを終了させると、dtrace の結果が表示されます。
dtrace のサンプルは
https://github.com/MacRuby/MacRubySamples/tree/master/DTrace
にいくつかあります。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment