Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1.TH CPUPOWER\-MONITOR "1" "22/02/2011" "" "cpupower Manual"
2.SH NAME
3cpupower\-monitor \- Report processor frequency and idle statistics
4.SH SYNOPSIS
5.ft B
6.B cpupower monitor
7.RB "\-l"
8
9.B cpupower monitor
10.RB [ -c ] [ "\-m <mon1>," [ "<mon2>,..." ] ]
11.RB [ "\-i seconds" ]
12.br
13.B cpupower monitor
14.RB [ -c ][ "\-m <mon1>," [ "<mon2>,..." ] ]
15.RB command
16.br
17.SH DESCRIPTION
18\fBcpupower-monitor \fP reports processor topology, frequency and idle power
19state statistics. Either \fBcommand\fP is forked and
20statistics are printed upon its completion, or statistics are printed periodically.
21
22\fBcpupower-monitor \fP implements independent processor sleep state and
23frequency counters. Some are retrieved from kernel statistics, some are
24directly reading out hardware registers. Use \-l to get an overview which are
25supported on your system.
26
27.SH Options
28.PP
29\-l
30.RS 4
31List available monitors on your system. Additional details about each monitor
32are shown:
33.RS 2
34.IP \(bu
35The name in quotation marks which can be passed to the \-m parameter.
36.IP \(bu
37The number of different counters the monitor supports in brackets.
38.IP \(bu
39The amount of time in seconds the counters might overflow, due to
40implementation constraints.
41.IP \(bu
42The name and a description of each counter and its processor hierarchy level
43coverage in square brackets:
44.RS 4
45.IP \(bu
46[T] \-> Thread
47.IP \(bu
48[C] \-> Core
49.IP \(bu
50[P] \-> Processor Package (Socket)
51.IP \(bu
52[M] \-> Machine/Platform wide counter
53.RE
54.RE
55.RE
56.PP
57\-m <mon1>,<mon2>,...
58.RS 4
59Only display specific monitors. Use the monitor string(s) provided by \-l option.
60.RE
61.PP
62\-i seconds
63.RS 4
64Measure interval.
65.RE
66.PP
67\-c
68.RS 4
69Schedule the process on every core before starting and ending measuring.
70This could be needed for the Idle_Stats monitor when no other MSR based
71monitor (has to be run on the core that is measured) is run in parallel.
72This is to wake up the processors from deeper sleep states and let the
73kernel re
74-account its cpuidle (C-state) information before reading the
75cpuidle timings from sysfs.
76.RE
77.PP
78command
79.RS 4
80Measure idle and frequency characteristics of an arbitrary command/workload.
81The executable \fBcommand\fP is forked and upon its exit, statistics gathered since it was
82forked are displayed.
83.RE
84
85.SH MONITOR DESCRIPTIONS
86.SS "Idle_Stats"
87Shows statistics of the cpuidle kernel subsystem. Values are retrieved from
88/sys/devices/system/cpu/cpu*/cpuidle/state*/.
89The kernel updates these values every time an idle state is entered or
90left. Therefore there can be some inaccuracy when cores are in an idle
91state for some time when the measure starts or ends. In worst case it can happen
92that one core stayed in an idle state for the whole measure time and the idle
93state usage time as exported by the kernel did not get updated. In this case
94a state residency of 0 percent is shown while it was 100.
95
96.SS "Mperf"
97The name comes from the aperf/mperf (average and maximum) MSR registers used
98which are available on recent X86 processors. It shows the average frequency
99(including boost frequencies).
100The fact that on all recent hardware the mperf timer stops ticking in any idle
101state it is also used to show C0 (processor is active) and Cx (processor is in
102any sleep state) times. These counters do not have the inaccuracy restrictions
103the "Idle_Stats" counters may show.
104May work poorly on Linux-2.6.20 through 2.6.29, as the \fBacpi-cpufreq \fP
105kernel frequency driver periodically cleared aperf/mperf registers in those
106kernels.
107
108.SS "Nehalem" "SandyBridge" "HaswellExtended"
109Intel Core and Package sleep state counters.
110Threads (hyperthreaded cores) may not be able to enter deeper core states if
111its sibling is utilized.
112Deepest package sleep states may in reality show up as machine/platform wide
113sleep states and can only be entered if all cores are idle. Look up Intel
114manuals (some are provided in the References section) for further details.
115The monitors are named after the CPU family where the sleep state capabilities
116got introduced and may not match exactly the CPU name of the platform.
117For example an IvyBridge processor has sleep state capabilities which got
118introduced in Nehalem and SandyBridge processor families.
119Thus on an IvyBridge processor one will get Nehalem and SandyBridge sleep
120state monitors.
121HaswellExtended extra package sleep state capabilities are available only in a
122specific Haswell (family 0x45) and probably also other future processors.
123
124.SS "Fam_12h" "Fam_14h"
125AMD laptop and desktop processor (family 12h and 14h) sleep state counters.
126The registers are accessed via PCI and therefore can still be read out while
127cores have been offlined.
128
129There is one special counter: NBP1 (North Bridge P1).
130This one always returns 0 or 1, depending on whether the North Bridge P1
131power state got entered at least once during measure time.
132Being able to enter NBP1 state also depends on graphics power management.
133Therefore this counter can be used to verify whether the graphics' driver
134power management is working as expected.
135
136.SH EXAMPLES
137
138cpupower monitor -l" may show:
139.RS 4
140Monitor "Mperf" (3 states) \- Might overflow after 922000000 s
141
142 ...
143
144Monitor "Idle_Stats" (3 states) \- Might overflow after 4294967295 s
145
146 ...
147
148.RE
149cpupower monitor \-m "Idle_Stats,Mperf" scp /tmp/test /nfs/tmp
150
151Monitor the scp command, show both Mperf and Idle_Stats states counter
152statistics, but in exchanged order.
153
154
155
156.RE
157Be careful that the typical command to fully utilize one CPU by doing:
158
159cpupower monitor cat /dev/zero >/dev/null
160
161Does not work as expected, because the measured output is redirected to
162/dev/null. This could get workarounded by putting the line into an own, tiny
163shell script. Hit CTRL\-c to terminate the command and get the measure output
164displayed.
165
166.SH REFERENCES
167"BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 14h Processors"
168https://support.amd.com/us/Processor_TechDocs/43170.pdf
169
170"What Is Intel® Turbo Boost Technology?"
171https://www.intel.com/content/www/us/en/gaming/resources/turbo-boost.html
172
173"Power Management - Technology Overview"
174https://cdrdv2.intel.com/v1/dl/getContent/637748
175
176"Intel® 64 and IA-32 Architectures Software Developer's Manual
177Volume 3B: System Programming Guide"
178https://www.intel.com/products/processor/manuals
179
180.SH FILES
181.ta
182.nf
183/dev/cpu/*/msr
184/sys/devices/system/cpu/cpu*/cpuidle/state*/.
185.fi
186
187.SH "SEE ALSO"
188powertop(8), msr(4), vmstat(8)
189.PP
190.SH AUTHORS
191.nf
192Written by Thomas Renninger <trenn@suse.de>
193
194Nehalem, SandyBridge monitors and command passing
195based on turbostat.8 from Len Brown <len.brown@intel.com>