xref: /netbsd-src/external/cddl/dtracetoolkit/dist/Docs/Examples/sar-c_example.txt (revision c29d51755812ace2e87aeefdb06cb2b4dac7087a)
1The following is a demonstration of the sar-c.d script.
2
3
4Here we run both sar-c.d and "sar -c 1 100" at the same time, to compare
5outputs.
6
7The DTrace script,
8
9 # ./sar-c.d
10 Time                 scall/s sread/s swrit/s  fork/s  exec/s  rchar/s  wchar/s
11 2005 Jun 14 02:40:24    1556      82      71    0.00    0.00    10262    10508
12 2005 Jun 14 02:40:25    1553      88      75    0.00    0.00    15095    15341
13 2005 Jun 14 02:40:26    1596      89      76    0.00    0.00    14885    15131
14 2005 Jun 14 02:40:27    5395     290     154    9.00   10.00   185991    77219
15 2005 Jun 14 02:40:28    1755      91      98    1.00    1.00    15421    16788
16 2005 Jun 14 02:40:29    1757     100      91    1.00    1.00    17127    17462
17 2005 Jun 14 02:40:30    1603      95      80    0.00    0.00    16767    16634
18 2005 Jun 14 02:40:31   14380      83    2420    1.00    1.00    14556   126461
19 2005 Jun 14 02:40:32   10573      88    1586    0.00    0.00    14222    87888
20 2005 Jun 14 02:40:33    1645      87      76    0.00    0.00    15320    15608
21 2005 Jun 14 02:40:34    2099     167     130    0.00    0.00   126295    74281
22 2005 Jun 14 02:40:35    1559      79      67    0.00    0.00    11663    11977
23 [...]
24
25The original command,
26
27 $ sar -c 1 100
28
29 SunOS jupiter 5.10 Generic i86pc    06/14/2005
30
31 02:40:23 scall/s sread/s swrit/s  fork/s  exec/s rchar/s wchar/s
32 02:40:24    1549      86      74    0.00    0.00   14799   15040
33 02:40:25    1552      85      73    0.00    0.00   14475   14719
34 02:40:26    5479     300     161    9.00   10.00  186755   77983
35 02:40:27    1725      86      94    0.99    0.99   14819   16172
36 02:40:28    1596      96      82    0.00    0.00   16521   16762
37 02:40:29    1716      93      85    1.00    1.00   16395   16730
38 02:40:30    1579      88      75    0.00    0.00   15324   15192
39 02:40:32   23036      79    3887    0.99    0.99   10113  193520
40 02:40:33    1756      94      83    0.00    0.00   14935   15300
41 02:40:34    2099     165     130    0.00    0.00  125051   73552
42 02:40:35    1560      82      69    0.00    0.00   15976   16287
43 [...]
44
45We can see that both tools are producing similar data.
46
47The DTrace output lacks the "summary since boot" line, as it is not using
48Kstat to fetch this data.
49
50
51The sar-c.d script is not intended itself as a useful program, rather it
52is intended as a starting point for other DTrace scripts; a starting point
53of familiar statistics to provide the programmer with a "common ground"
54of knowledge.
55
56