Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v3.2 179 lines 5.7 kB view raw
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 [ "\-m <mon1>," [ "<mon2>,..." ] ] 11.RB [ "\-i seconds" ] 12.br 13.B cpupower monitor 14.RB [ "\-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 intervall. 65.RE 66.PP 67command 68.RS 4 69Measure idle and frequency characteristics of an arbitrary command/workload. 70The executable \fBcommand\fP is forked and upon its exit, statistics gathered since it was 71forked are displayed. 72.RE 73.PP 74\-v 75.RS 4 76Increase verbosity if the binary was compiled with the DEBUG option set. 77.RE 78 79.SH MONITOR DESCRIPTIONS 80.SS "Idle_Stats" 81Shows statistics of the cpuidle kernel subsystem. Values are retrieved from 82/sys/devices/system/cpu/cpu*/cpuidle/state*/. 83The kernel updates these values every time an idle state is entered or 84left. Therefore there can be some inaccuracy when cores are in an idle 85state for some time when the measure starts or ends. In worst case it can happen 86that one core stayed in an idle state for the whole measure time and the idle 87state usage time as exported by the kernel did not get updated. In this case 88a state residency of 0 percent is shown while it was 100. 89 90.SS "Mperf" 91The name comes from the aperf/mperf (average and maximum) MSR registers used 92which are available on recent X86 processors. It shows the average frequency 93(including boost frequencies). 94The fact that on all recent hardware the mperf timer stops ticking in any idle 95state it is also used to show C0 (processor is active) and Cx (processor is in 96any sleep state) times. These counters do not have the inaccuracy restrictions 97the "Idle_Stats" counters may show. 98May work poorly on Linux-2.6.20 through 2.6.29, as the \fBacpi-cpufreq \fP 99kernel frequency driver periodically cleared aperf/mperf registers in those 100kernels. 101 102.SS "Nehalem" "SandyBridge" 103Intel Core and Package sleep state counters. 104Threads (hyperthreaded cores) may not be able to enter deeper core states if 105its sibling is utilized. 106Deepest package sleep states may in reality show up as machine/platform wide 107sleep states and can only be entered if all cores are idle. Look up Intel 108manuals (some are provided in the References section) for further details. 109 110.SS "Ontario" "Liano" 111AMD laptop and desktop processor (family 12h and 14h) sleep state counters. 112The registers are accessed via PCI and therefore can still be read out while 113cores have been offlined. 114 115There is one special counter: NBP1 (North Bridge P1). 116This one always returns 0 or 1, depending on whether the North Bridge P1 117power state got entered at least once during measure time. 118Being able to enter NBP1 state also depends on graphics power management. 119Therefore this counter can be used to verify whether the graphics' driver 120power management is working as expected. 121 122.SH EXAMPLES 123 124cpupower monitor -l" may show: 125.RS 4 126Monitor "Mperf" (3 states) \- Might overflow after 922000000 s 127 128 ... 129 130Monitor "Idle_Stats" (3 states) \- Might overflow after 4294967295 s 131 132 ... 133 134.RE 135cpupower monitor \-m "Idle_Stats,Mperf" scp /tmp/test /nfs/tmp 136 137Monitor the scp command, show both Mperf and Idle_Stats states counter 138statistics, but in exchanged order. 139 140 141 142.RE 143Be careful that the typical command to fully utilize one CPU by doing: 144 145cpupower monitor cat /dev/zero >/dev/null 146 147Does not work as expected, because the measured output is redirected to 148/dev/null. This could get workarounded by putting the line into an own, tiny 149shell script. Hit CTRL\-c to terminate the command and get the measure output 150displayed. 151 152.SH REFERENCES 153"BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 14h Processors" 154http://support.amd.com/us/Processor_TechDocs/43170.pdf 155 156"Intel® Turbo Boost Technology 157in Intel® Core™ Microarchitecture (Nehalem) Based Processors" 158http://download.intel.com/design/processor/applnots/320354.pdf 159 160"Intel® 64 and IA-32 Architectures Software Developer's Manual 161Volume 3B: System Programming Guide" 162http://www.intel.com/products/processor/manuals 163 164.SH FILES 165.ta 166.nf 167/dev/cpu/*/msr 168/sys/devices/system/cpu/cpu*/cpuidle/state*/. 169.fi 170 171.SH "SEE ALSO" 172powertop(8), msr(4), vmstat(8) 173.PP 174.SH AUTHORS 175.nf 176Written by Thomas Renninger <trenn@suse.de> 177 178Nehalem, SandyBridge monitors and command passing 179based on turbostat.8 from Len Brown <len.brown@intel.com>