Add unit test for bug 32888
[lhc/web/wiklou.git] / maintenance / dtrace / tree.d
1 /*
2 * This software is in the public domain.
3 *
4 * $Id$
5 */
6
7 #pragma D option quiet
8
9 self int indent;
10 self int times[int];
11
12 php$target:::function-entry
13 {
14 @counts[copyinstr(arg0)] = count();
15 printf("%*s", self->indent, "");
16 printf("-> %s\n", copyinstr(arg0));
17 self->times[self->indent] = timestamp;
18 self->indent += 2;
19 }
20
21 php$target:::function-return
22 {
23 self->indent -= 2;
24 printf("%*s", self->indent, "");
25 printf("<- %s %dus\n", copyinstr(arg0), (timestamp - self->times[self->indent]) / 1000);
26 }