Small sampling interval with cpustat(1M)

It never ceases to amaze me that, even with tools that I use quite frequently, I can still learn new things about those tools. I recently had one of those experiences with cpustat(1M), a tool used to read performance counters from CPU's. Like most other observational tools of this ilk, cpustat allows you to specify a sampling interval. However, unlike most other tools, it allows you to specify intervals with a sub-second granularity - this is something I never knew.

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      2791 
Simple stuff but something which had evaded me until now. The most excellent Sriram brought this to my attention - thanks Sriram.
Comments:

Post a Comment:
Comments are closed for this entry.
About

jonh

Search

Categories
Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today