1The following is an example of the vmstat.d script, 2 3 4We run both vmstat.d and the original vmstat(1M) command at the same time 5to compare outputs, 6 7 $ vmstat 1 8 kthr memory page disk faults cpu 9 r b w swap free re mf pi po fr de sr cd s0 -- -- in sy cs us sy id 10 0 0 0 1147468 144324 2 8 2 1 1 0 0 1 0 0 0 294 990 355 18 2 80 11 1 0 0 1065480 92276 13 73 0 0 0 0 0 0 0 0 0 359 1055 376 85 15 0 12 0 0 0 1052088 82940 0 0 0 0 0 0 0 0 0 0 0 409 999 402 97 3 0 13 0 0 0 1052088 82940 0 0 0 0 0 0 0 0 0 0 0 406 975 407 97 3 0 14 0 0 0 1052088 82940 0 0 0 0 0 0 0 0 0 0 0 406 1037 429 97 3 0 15 0 0 0 1052088 82940 247 1763 0 0 0 0 0 2 0 0 0 427 4828 680 81 19 0 16 0 0 0 1051264 82300 0 0 0 0 0 0 0 0 0 0 0 414 1164 441 97 3 0 17 0 0 0 1051264 82300 11 134 0 0 0 0 0 0 0 0 0 423 1218 461 95 5 0 18 0 0 0 1051264 82300 0 0 0 0 0 0 0 0 0 0 0 416 1054 435 98 2 0 19 [...] 20 21 # ./vmstat.d 22 w swap free re mf pi po fr sr in sy cs 23 0 1052088 82940 8 80 0 0 0 0 117 958 379 24 0 1052088 82940 0 0 0 0 0 0 123 955 402 25 0 1052088 82940 0 0 0 0 0 0 121 1025 420 26 0 1052088 82940 0 0 0 0 0 0 121 1065 433 27 0 1051264 82300 1008 7192 0 0 0 0 219 4886 684 28 0 1051264 82300 0 0 0 0 0 0 193 1188 461 29 0 1051264 82300 44 540 0 0 0 0 165 1226 450 30 0 1051264 82300 0 0 0 0 0 0 123 1012 421 31 [...] 32 33Above we can see the columns are corresponding well. "re" and "mf" in the 34DTrace output appear four times as large as they should be, because in the 35DTrace output we are printing Kbs not page counts (for consistancy). 36 37The DTrace output lacks the "summary since boot" line, as it is not using 38Kstat to fetch this data. 39 40 41The vmstat.d script is not intended itself as a useful program, rather it 42is intended as a starting point for other DTrace scripts; a starting point 43of familiar statistics to provide the programmer with a "common ground" 44of knowledge. 45 46