aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/x86/turbostat/turbostat.8
diff options
context:
space:
mode:
Diffstat (limited to 'tools/power/x86/turbostat/turbostat.8')
-rw-r--r--tools/power/x86/turbostat/turbostat.8126
1 files changed, 80 insertions, 46 deletions
diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
index 56bfb523c5bb..feea7ad9500b 100644
--- a/tools/power/x86/turbostat/turbostat.8
+++ b/tools/power/x86/turbostat/turbostat.8
@@ -9,40 +9,50 @@ turbostat \- Report processor frequency and idle statistics
9.br 9.br
10.B turbostat 10.B turbostat
11.RB [ Options ] 11.RB [ Options ]
12.RB [ "\-i interval_sec" ] 12.RB [ "\--interval seconds" ]
13.SH DESCRIPTION 13.SH DESCRIPTION
14\fBturbostat \fP reports processor topology, frequency, 14\fBturbostat \fP reports processor topology, frequency,
15idle power-state statistics, temperature and power on modern X86 processors. 15idle power-state statistics, temperature and power on X86 processors.
16Either \fBcommand\fP is forked and statistics are printed 16There are two ways to invoke turbostat.
17upon its completion, or statistics are printed periodically. 17The first method is to supply a
18 18\fBcommand\fP, which is forked and statistics are printed
19\fBturbostat \fP 19upon its completion.
20must be run on root, and 20The second method is to omit the command,
21minimally requires that the processor 21and turbostat displays statistics every 5 seconds.
22supports an "invariant" TSC, plus the APERF and MPERF MSRs. 22The 5-second interval can be changed using the --interval option.
23Additional information is reported depending on hardware counter support. 23
24 24Some information is not available on older processors.
25.SS Options 25.SS Options
26The \fB-p\fP option limits output to the 1st thread in 1st core of each package. 26\fB--Counter MSR#\fP shows the delta of the specified 64-bit MSR counter.
27.PP
28\fB--counter MSR#\fP shows the delta of the specified 32-bit MSR counter.
29.PP
30\fB--Dump\fP displays the raw counter values.
31.PP
32\fB--debug\fP displays additional system configuration information. Invoking this parameter
33more than once may also enable internal turbostat debug information.
34.PP
35\fB--interval seconds\fP overrides the default 5-second measurement interval.
36.PP
37\fB--help\fP displays usage for the most common parameters.
27.PP 38.PP
28The \fB-P\fP option limits output to the 1st thread in each Package. 39\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
29.PP 40.PP
30The \fB-S\fP option limits output to a 1-line System Summary for each interval. 41\fB--MSR MSR#\fP shows the specified 64-bit MSR value.
31.PP 42.PP
32The \fB-v\fP option increases verbosity. 43\fB--msr MSR#\fP shows the specified 32-bit MSR value.
33.PP 44.PP
34The \fB-c MSR#\fP option includes the delta of the specified 32-bit MSR counter. 45\fB--Package\fP limits output to the system summary plus the 1st thread in each Package.
35.PP 46.PP
36The \fB-C MSR#\fP option includes the delta of the specified 64-bit MSR counter. 47\fB--processor\fP limits output to the system summary plus the 1st thread in each processor of each package. Ie. it skips hyper-threaded siblings.
37.PP 48.PP
38The \fB-m MSR#\fP option includes the the specified 32-bit MSR value. 49\fB--Summary\fP limits output to a 1-line System Summary for each interval.
39.PP 50.PP
40The \fB-M MSR#\fP option includes the the specified 64-bit MSR value. 51\fB--TCC temperature\fP sets the Thermal Control Circuit temperature for systems which do not export that value. This is used for making sense of the Digital Thermal Sensor outputs, as they return degrees Celsius below the TCC activation temperature.
41.PP 52.PP
42The \fB-i interval_sec\fP option prints statistics every \fiinterval_sec\fP seconds. 53\fB--version\fP displays the version.
43The default is 5 seconds.
44.PP 54.PP
45The \fBcommand\fP parameter forks \fBcommand\fP and upon its exit, 55The \fBcommand\fP parameter forks \fBcommand\fP, and upon its exit,
46displays the statistics gathered since it was forked. 56displays the statistics gathered since it was forked.
47.PP 57.PP
48.SH FIELD DESCRIPTIONS 58.SH FIELD DESCRIPTIONS
@@ -52,7 +62,7 @@ displays the statistics gathered since it was forked.
52\fBCPU\fP Linux CPU (logical processor) number. 62\fBCPU\fP Linux CPU (logical processor) number.
53Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology. 63Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology.
54\fBAVG_MHz\fP number of cycles executed divided by time elapsed. 64\fBAVG_MHz\fP number of cycles executed divided by time elapsed.
55\fB%Buzy\fP percent of the interval that the CPU retired instructions, aka. % of time in "C0" state. 65\fB%Busy\fP percent of the interval that the CPU retired instructions, aka. % of time in "C0" state.
56\fBBzy_MHz\fP average clock rate while the CPU was busy (in "c0" state). 66\fBBzy_MHz\fP average clock rate while the CPU was busy (in "c0" state).
57\fBTSC_MHz\fP average MHz that the TSC ran during the entire interval. 67\fBTSC_MHz\fP average MHz that the TSC ran during the entire interval.
58\fBCPU%c1, CPU%c3, CPU%c6, CPU%c7\fP show the percentage residency in hardware core idle states. 68\fBCPU%c1, CPU%c3, CPU%c6, CPU%c7\fP show the percentage residency in hardware core idle states.
@@ -68,7 +78,7 @@ Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading T
68.fi 78.fi
69.PP 79.PP
70.SH EXAMPLE 80.SH EXAMPLE
71Without any parameters, turbostat prints out counters ever 5 seconds. 81Without any parameters, turbostat displays statistics ever 5 seconds.
72(override interval with "-i sec" option, or specify a command 82(override interval with "-i sec" option, or specify a command
73for turbostat to fork). 83for turbostat to fork).
74 84
@@ -91,19 +101,19 @@ Subsequent rows show per-CPU statistics.
91 3 3 3 0.20 1596 3492 0 0.44 0.00 99.37 0.00 23 101 3 3 3 0.20 1596 3492 0 0.44 0.00 99.37 0.00 23
92 3 7 5 0.31 1596 3492 0 0.33 102 3 7 5 0.31 1596 3492 0 0.33
93.fi 103.fi
94.SH VERBOSE EXAMPLE 104.SH DEBUG EXAMPLE
95The "-v" option adds verbosity to the output: 105The "--debug" option prints additional system information before measurements:
96 106
97.nf 107.nf
98[root@ivy]# turbostat -v 108turbostat version 4.0 10-Feb, 2015 - Len Brown <lenb@kernel.org>
99turbostat v3.0 November 23, 2012 - Len Brown <lenb@kernel.org>
100CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3a:9 (6:58:9) 109CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3a:9 (6:58:9)
101CPUID(6): APERF, DTS, PTM, EPB 110CPUID(6): APERF, DTS, PTM, EPB
102RAPL: 851 sec. Joule Counter Range 111RAPL: 851 sec. Joule Counter Range, at 77 Watts
103cpu0: MSR_NHM_PLATFORM_INFO: 0x81010f0012300 112cpu0: MSR_NHM_PLATFORM_INFO: 0x81010f0012300
10416 * 100 = 1600 MHz max efficiency 11316 * 100 = 1600 MHz max efficiency
10535 * 100 = 3500 MHz TSC frequency 11435 * 100 = 3500 MHz TSC frequency
106cpu0: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x1e008402 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked: pkg-cstate-limit=2: pc6-noret) 115cpu0: MSR_IA32_POWER_CTL: 0x0014005d (C1E auto-promotion: DISabled)
116cpu0: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x1e008402 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked: pkg-cstate-limit=2: pc6n)
107cpu0: MSR_NHM_TURBO_RATIO_LIMIT: 0x25262727 117cpu0: MSR_NHM_TURBO_RATIO_LIMIT: 0x25262727
10837 * 100 = 3700 MHz max turbo 4 active cores 11837 * 100 = 3700 MHz max turbo 4 active cores
10938 * 100 = 3800 MHz max turbo 3 active cores 11938 * 100 = 3800 MHz max turbo 3 active cores
@@ -112,9 +122,9 @@ cpu0: MSR_NHM_TURBO_RATIO_LIMIT: 0x25262727
112cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced) 122cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
113cpu0: MSR_RAPL_POWER_UNIT: 0x000a1003 (0.125000 Watts, 0.000015 Joules, 0.000977 sec.) 123cpu0: MSR_RAPL_POWER_UNIT: 0x000a1003 (0.125000 Watts, 0.000015 Joules, 0.000977 sec.)
114cpu0: MSR_PKG_POWER_INFO: 0x01e00268 (77 W TDP, RAPL 60 - 0 W, 0.000000 sec.) 124cpu0: MSR_PKG_POWER_INFO: 0x01e00268 (77 W TDP, RAPL 60 - 0 W, 0.000000 sec.)
115cpu0: MSR_PKG_POWER_LIMIT: 0x830000148268 (UNlocked) 125cpu0: MSR_PKG_POWER_LIMIT: 0x30000148268 (UNlocked)
116cpu0: PKG Limit #1: ENabled (77.000000 Watts, 1.000000 sec, clamp DISabled) 126cpu0: PKG Limit #1: ENabled (77.000000 Watts, 1.000000 sec, clamp DISabled)
117cpu0: PKG Limit #2: ENabled (96.000000 Watts, 0.000977* sec, clamp DISabled) 127cpu0: PKG Limit #2: DISabled (96.000000 Watts, 0.000977* sec, clamp DISabled)
118cpu0: MSR_PP0_POLICY: 0 128cpu0: MSR_PP0_POLICY: 0
119cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked) 129cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
120cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled) 130cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
@@ -123,19 +133,20 @@ cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
123cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled) 133cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
124cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00691400 (105 C) 134cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00691400 (105 C)
125cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x884e0000 (27 C) 135cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x884e0000 (27 C)
126cpu0: MSR_IA32_THERM_STATUS: 0x88560000 (19 C +/- 1) 136cpu0: MSR_IA32_THERM_STATUS: 0x88580000 (17 C +/- 1)
127cpu1: MSR_IA32_THERM_STATUS: 0x88560000 (19 C +/- 1) 137cpu1: MSR_IA32_THERM_STATUS: 0x885a0000 (15 C +/- 1)
128cpu2: MSR_IA32_THERM_STATUS: 0x88540000 (21 C +/- 1) 138cpu2: MSR_IA32_THERM_STATUS: 0x88570000 (18 C +/- 1)
129cpu3: MSR_IA32_THERM_STATUS: 0x884e0000 (27 C +/- 1) 139cpu3: MSR_IA32_THERM_STATUS: 0x884e0000 (27 C +/- 1)
130 ... 140 ...
131.fi 141.fi
132The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency 142The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
133available at the minimum package voltage. The \fBTSC frequency\fP is the nominal 143available at the minimum package voltage. The \fBTSC frequency\fP is the base
134maximum frequency of the processor if turbo-mode were not available. This frequency 144frequency of the processor -- this should match the brand string
145in /proc/cpuinfo. This base frequency
135should be sustainable on all CPUs indefinitely, given nominal power and cooling. 146should be sustainable on all CPUs indefinitely, given nominal power and cooling.
136The remaining rows show what maximum turbo frequency is possible 147The remaining rows show what maximum turbo frequency is possible
137depending on the number of idle cores. Note that this information is 148depending on the number of idle cores. Note that not all information is
138not available on all processors. 149available on all processors.
139.SH FORK EXAMPLE 150.SH FORK EXAMPLE
140If turbostat is invoked with a command, it will fork that command 151If turbostat is invoked with a command, it will fork that command
141and output the statistics gathered when the command exits. 152and output the statistics gathered when the command exits.
@@ -176,6 +187,11 @@ not including any non-busy idle time.
176 187
177.B "turbostat " 188.B "turbostat "
178must be run as root. 189must be run as root.
190Alternatively, non-root users can be enabled to run turbostat this way:
191
192# setcap cap_sys_rawio=ep ./turbostat
193
194# chmod +r /dev/cpu/*/msr
179 195
180.B "turbostat " 196.B "turbostat "
181reads hardware counters, but doesn't write them. 197reads hardware counters, but doesn't write them.
@@ -184,15 +200,33 @@ multiple invocations of itself.
184 200
185\fBturbostat \fP 201\fBturbostat \fP
186may work poorly on Linux-2.6.20 through 2.6.29, 202may work poorly on Linux-2.6.20 through 2.6.29,
187as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF 203as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF MSRs
188in those kernels. 204in those kernels.
189 205
190If the TSC column does not make sense, then 206AVG_MHz = APERF_delta/measurement_interval. This is the actual
191the other numbers will also make no sense. 207number of elapsed cycles divided by the entire sample interval --
192Turbostat is lightweight, and its data collection is not atomic. 208including idle time. Note that this calculation is resilient
193These issues are usually caused by an extremely short measurement 209to systems lacking a non-stop TSC.
194interval (much less than 1 second), or system activity that prevents 210
195turbostat from being able to run on all CPUS to quickly collect data. 211TSC_MHz = TSC_delta/measurement_interval.
212On a system with an invariant TSC, this value will be constant
213and will closely match the base frequency value shown
214in the brand string in /proc/cpuinfo. On a system where
215the TSC stops in idle, TSC_MHz will drop
216below the processor's base frequency.
217
218%Busy = MPERF_delta/TSC_delta
219
220Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
221
222Note that these calculations depend on TSC_delta, so they
223are not reliable during intervals when TSC_MHz is not running at the base frequency.
224
225Turbostat data collection is not atomic.
226Extremely short measurement intervals (much less than 1 second),
227or system activity that prevents turbostat from being able
228to run on all CPUS to quickly collect data, will result in
229inconsistent results.
196 230
197The APERF, MPERF MSRs are defined to count non-halted cycles. 231The APERF, MPERF MSRs are defined to count non-halted cycles.
198Although it is not guaranteed by the architecture, turbostat assumes 232Although it is not guaranteed by the architecture, turbostat assumes