Small sampling interval with cpustat(1M)
The following example is on an Opteron based system. I'm using 2 of it's 4 pic counters (a pic counter is a hardware counter used to record events of interest) to measure user mode level 1 icache misses in pic0 and system mode level 1 icache misses in pic1. The sampling interval is every half a second:
# cpustat -c pic0=IC_miss,pic1=IC_miss,sys1,nouser1 0.5 time cpu event pic0 pic1 0.507 1 tick 796 3126 0.507 0 tick 574 3785 1.007 0 tick 263 3564 1.007 1 tick 21584 4851 1.507 0 tick 1416 5542 1.507 1 tick 6116 12318 2.007 0 tick 753 3817 2.007 1 tick 869 2507 2.507 1 tick 1345 3150 2.507 0 tick 185 2791Simple stuff but something which had evaded me until now. The most excellent Sriram brought this to my attention - thanks Sriram.