1CPUPOWER-MONITOR(1) cpupower Manual CPUPOWER-MONITOR(1)
2
3
4
6 cpupower-monitor - Report processor frequency and idle statistics
7
9 cpupower monitor -l
10
11 cpupower monitor [-m <mon1>,[<mon2>,...]] [-i seconds]
12 cpupower monitor [-m <mon1>,[<mon2>,...]] command
13
15 cpupower-monitor reports processor topology, frequency and idle power
16 state statistics. Either command is forked and statistics are printed
17 upon its completion, or statistics are printed periodically.
18
19 cpupower-monitor implements independent processor sleep state and fre‐
20 quency counters. Some are retrieved from kernel statistics, some are
21 directly reading out hardware registers. Use -l to get an overview
22 which are supported on your system.
23
24
26 -l
27 List available monitors on your system. Additional details about
28 each monitor are shown:
29
30 · The name in quotation marks which can be passed to the -m
31 parameter.
32
33 · The number of different counters the monitor supports in
34 brackets.
35
36 · The amount of time in seconds the counters might overflow,
37 due to implementation constraints.
38
39 · The name and a description of each counter and its proces‐
40 sor hierarchy level coverage in square brackets:
41
42 · [T] -> Thread
43
44 · [C] -> Core
45
46 · [P] -> Processor Package (Socket)
47
48 · [M] -> Machine/Platform wide counter
49
50 -m <mon1>,<mon2>,...
51 Only display specific monitors. Use the monitor string(s) provided
52 by -l option.
53
54 -i seconds
55 Measure intervall.
56
57 command
58 Measure idle and frequency characteristics of an arbitrary com‐
59 mand/workload. The executable command is forked and upon its exit,
60 statistics gathered since it was forked are displayed.
61
62 -v
63 Increase verbosity if the binary was compiled with the DEBUG option
64 set.
65
66
68 Idle_Stats
69 Shows statistics of the cpuidle kernel subsystem. Values are retrieved
70 from /sys/devices/system/cpu/cpu*/cpuidle/state*/. The kernel updates
71 these values every time an idle state is entered or left. Therefore
72 there can be some inaccuracy when cores are in an idle state for some
73 time when the measure starts or ends. In worst case it can happen that
74 one core stayed in an idle state for the whole measure time and the
75 idle state usage time as exported by the kernel did not get updated. In
76 this case a state residency of 0 percent is shown while it was 100.
77
78
79 Mperf
80 The name comes from the aperf/mperf (average and maximum) MSR registers
81 used which are available on recent X86 processors. It shows the average
82 frequency (including boost frequencies). The fact that on all recent
83 hardware the mperf timer stops ticking in any idle state it is also
84 used to show C0 (processor is active) and Cx (processor is in any sleep
85 state) times. These counters do not have the inaccuracy restrictions
86 the "Idle_Stats" counters may show. May work poorly on Linux-2.6.20
87 through 2.6.29, as the acpi-cpufreq kernel frequency driver periodi‐
88 cally cleared aperf/mperf registers in those kernels.
89
90
91 Nehalem SandyBridge
92 Intel Core and Package sleep state counters. Threads (hyperthreaded
93 cores) may not be able to enter deeper core states if its sibling is
94 utilized. Deepest package sleep states may in reality show up as
95 machine/platform wide sleep states and can only be entered if all cores
96 are idle. Look up Intel manuals (some are provided in the References
97 section) for further details.
98
99
100 Ontario Liano
101 AMD laptop and desktop processor (family 12h and 14h) sleep state coun‐
102 ters. The registers are accessed via PCI and therefore can still be
103 read out while cores have been offlined.
104
105 There is one special counter: NBP1 (North Bridge P1). This one always
106 returns 0 or 1, depending on whether the North Bridge P1 power state
107 got entered at least once during measure time. Being able to enter
108 NBP1 state also depends on graphics power management. Therefore this
109 counter can be used to verify whether the graphics' driver power man‐
110 agement is working as expected.
111
112
114 cpupower monitor -l" may show:
115 Monitor "Mperf" (3 states) - Might overflow after 922000000 s
116
117 ...
118
119 Monitor "Idle_Stats" (3 states) - Might overflow after 4294967295 s
120
121 ...
122
123 cpupower monitor -m "Idle_Stats,Mperf" scp /tmp/test /nfs/tmp
124
125 Monitor the scp command, show both Mperf and Idle_Stats states counter
126 statistics, but in exchanged order.
127
128
129
130 Be careful that the typical command to fully utilize one CPU by doing:
131
132 cpupower monitor cat /dev/zero >/dev/null
133
134 Does not work as expected, because the measured output is redirected to
135 /dev/null. This could get workarounded by putting the line into an own,
136 tiny shell script. Hit CTRL-c to terminate the command and get the mea‐
137 sure output displayed.
138
139
141 "BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 14h Proces‐
142 sors" http://support.amd.com/us/Processor_TechDocs/43170.pdf
143
144 "Intel® Turbo Boost Technology in Intel® Core™ Microarchitecture
145 (Nehalem) Based Processors" http://download.intel.com/design/proces‐
146 sor/applnots/320354.pdf
147
148 "Intel® 64 and IA-32 Architectures Software Developer's Manual Volume
149 3B: System Programming Guide" http://www.intel.com/products/proces‐
150 sor/manuals
151
152
154 /dev/cpu/*/msr
155 /sys/devices/system/cpu/cpu*/cpuidle/state*/.
156
157
159 powertop(8), msr(4), vmstat(8)
160
162 Written by Thomas Renninger <trenn@suse.de>
163
164 Nehalem, SandyBridge monitors and command passing
165 based on turbostat.8 from Len Brown <len.brown@intel.com>
166
167
168
169 22/02/2011 CPUPOWER-MONITOR(1)