4 * This script manages a counter for every method invocation. Upon function-entry the probe increments
5 * the counter, upon function-return the counter decrements the counter. At the end of the run
6 * dtrace should print all methods run, with a count of 0 for all of them - indicating that the probes
7 * have fired correctly.
11 * $> sudo dtrace -s entry-counts.d -c 'rbx ~/hello.rb'
14 #
pragma D option dynvarsize
=250m
15 #
pragma D option bufsize
=64m
16 #
pragma D option quiet
18 rubinius
$target
:::function-entry
{ @
[copyinstr(arg0
), copyinstr(arg1
)] = sum(1); }
19 rubinius
$target
:::function-return { @
[copyinstr(arg0
), copyinstr(arg1
)] = sum(-1); }