xref: /netbsd-src/external/cddl/dtracetoolkit/dist/Examples/sh_stat_example.txt (revision c29d51755812ace2e87aeefdb06cb2b4dac7087a)
1Following are examples of running sh_stat.d on Shell scripts.
2
3sh_stat.d shows you the number of events per second that have happened since
4the last line output.  The default interval is 1 second, but you can specify
5other intervals as arguments to the script.
6
7This shows the sh_stat.d script reflecting the Code/Shell/func_slow.sh script.
8
9   # sh_stat.d
10   TIME                   EXEC/s  FUNCS/s BLTINS/s SUB-SH/s    CMD/s
11   2007 Sep 17 03:29:02        1        1       50       96        0
12   2007 Sep 17 03:29:03        0        1      151      300        0
13   2007 Sep 17 03:29:04        0        1      142      280        0
14   2007 Sep 17 03:29:05        0        0      132      262        0
15   2007 Sep 17 03:29:06        0        0      122      245        0
16   2007 Sep 17 03:29:07        0        0        9       17        0
17   2007 Sep 17 03:29:08        0        0        0        0        0
18   2007 Sep 17 03:29:09        0        0        0        0        0
19   ^C
20
21We can see that at 2007 Sep 17 03:29:04 there were 0 Bourne shells executed,
22one function called, 142 built-in commands called, 280 sub-shells created and
230 external commands called.
24
25
26Here the script runs when Mozilla Firefox is started.
27
28   # sh_stat.d
29   TIME                   EXEC/s  FUNCS/s BLTINS/s SUB-SH/s    CMD/s
30   2007 Sep 17 03:29:52        1        9       52       38        2
31   2007 Sep 17 03:29:53        0        0        0        0        0
32   2007 Sep 17 03:29:54        0        0        0        0        0
33   2007 Sep 17 03:29:55        0        0        0        0        0
34   2007 Sep 17 03:29:56        0        0        0        0        0
35   2007 Sep 17 03:29:57        0        0        0        0        0
36   2007 Sep 17 03:29:58        0        0        0        0        0
37   2007 Sep 17 03:29:59        0        0        0        0        0
38   2007 Sep 17 03:30:00        0        0        0        0        0
39   2007 Sep 17 03:30:01        1        1        8        0        0
40   2007 Sep 17 03:30:02        0        0        0        0        0
41   2007 Sep 17 03:30:03        0        0        0        0        0
42   2007 Sep 17 03:30:04        0        0        0        0        0
43   ^C
44
45