Linux 6.10-rc6
[linux-2.6-block.git] / tools / power / x86 / turbostat / turbostat.8
1 .TH TURBOSTAT 8
2 .SH NAME
3 turbostat \- Report processor frequency and idle statistics
4 .SH SYNOPSIS
5 .ft B
6 .B turbostat
7 .RB [ Options ]
8 .RB command
9 .br
10 .B turbostat
11 .RB [ Options ]
12 .RB [ "\--interval seconds" ]
13 .SH DESCRIPTION
14 \fBturbostat \fP reports processor topology, frequency,
15 idle power-state statistics, temperature and power on X86 processors.
16 There are two ways to invoke turbostat.
17 The first method is to supply a
18 \fBcommand\fP, which is forked and statistics are printed
19 in one-shot upon its completion.
20 The second method is to omit the command,
21 and turbostat displays statistics every 5 seconds interval.
22 The 5-second interval can be changed using the --interval option.
23 .PP
24 Some information is not available on older processors.
25 .SS Options
26 Options can be specified with a single or double '-', and only as much of the option
27 name as necessary to disambiguate it from others is necessary.  Note that options are case-sensitive.
28 .PP
29 \fB--add attributes\fP add column with counter having specified 'attributes'.  The 'location' attribute is required, all others are optional.
30 .nf
31         location: {\fBmsrDDD\fP | \fBmsr0xXXX\fP | \fB/sys/path...\fP}
32                 msrDDD is a decimal offset, eg. msr16
33                 msr0xXXX is a hex offset, eg. msr0x10
34                 /sys/path... is an absolute path to a sysfs attribute
35
36         scope: {\fBcpu\fP | \fBcore\fP | \fBpackage\fP}
37                 sample and print the counter for every cpu, core, or package.
38                 default: cpu
39
40         size: {\fBu32\fP | \fBu64\fP }
41                 MSRs are read as 64-bits, u32 truncates the displayed value to 32-bits.
42                 default: u64
43
44         format: {\fBraw\fP | \fBdelta\fP | \fBpercent\fP}
45                 'raw' shows the MSR contents in hex.
46                 'delta' shows the difference in values during the measurement interval.
47                 'percent' shows the delta as a percentage of the cycles elapsed.
48                 default: delta
49
50         name: "name_string"
51                 Any string that does not match a key-word above is used
52                 as the column header.
53 .fi
54 .PP
55 \fB--cpu cpu-set\fP limit output to system summary plus the specified cpu-set.  If cpu-set is the string "core", then the system summary plus the first CPU in each core are printed -- eg. subsequent HT siblings are not printed.  Or if cpu-set is the string "package", then the system summary plus the first CPU in each package is printed.  Otherwise, the system summary plus the specified set of CPUs are printed.  The cpu-set is ordered from low to high, comma delimited with ".." and "-" permitted to denote a range. eg. 1,2,8,14..17,21-44
56 .PP
57 \fB--hide column\fP do not show the specified built-in columns.  May be invoked multiple times, or with a comma-separated list of column names.
58 .PP
59 \fB--enable column\fP show the specified built-in columns, which are otherwise disabled, by default.  Currently the only built-in counters disabled by default are "usec", "Time_Of_Day_Seconds", "APIC" and "X2APIC".
60 The column name "all" can be used to enable all disabled-by-default built-in counters.
61 .PP
62 \fB--show column\fP show only the specified built-in columns.  May be invoked multiple times, or with a comma-separated list of column names.
63 .PP
64 \fB--show CATEGORY --hide CATEGORY\fP  Show and hide also accept a single CATEGORY of columns: "all", "topology", "idle", "frequency", "power", "sysfs", "other".
65 .PP
66 \fB--Dump\fP displays the raw counter values.
67 .PP
68 \fB--quiet\fP Do not decode and print the system configuration header information.
69 .PP
70 +\fB--no-msr\fP Disable all the uses of the MSR driver.
71 +.PP
72 +\fB--no-perf\fP Disable all the uses of the perf API.
73 +.PP
74 \fB--interval seconds\fP overrides the default 5.0 second measurement interval.
75 .PP
76 \fB--num_iterations num\fP number of the measurement iterations.
77 .PP
78 \fB--out output_file\fP turbostat output is written to the specified output_file.
79 The file is truncated if it already exists, and it is created if it does not exist.
80 .PP
81 \fB--help\fP displays usage for the most common parameters.
82 .PP
83 \fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
84 .PP
85 \fB--list\fP display column header names available for use by --show and --hide, then exit.
86 .PP
87 \fB--Summary\fP limits output to a 1-line System Summary for each interval.
88 .PP
89 \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.
90 .PP
91 \fB--version\fP displays the version.
92 .PP
93 The \fBcommand\fP parameter forks \fBcommand\fP, and upon its exit,
94 displays the statistics gathered since it was forked.
95 .PP
96 .SH ROW DESCRIPTIONS
97 The system configuration dump (if --quiet is not used) is followed by statistics.  The first row of the statistics labels the content of each column (below).  The second row of statistics is the system summary line.  The system summary line has a '-' in the columns for the Package, Core, and CPU.  The contents of the system summary line depends on the type of column.  Columns that count items (eg. IRQ) show the sum across all CPUs in the system.  Columns that show a percentage show the average across all CPUs in the system.  Columns that dump raw MSR values simply show 0 in the summary.  After the system summary row, each row describes a specific Package/Core/CPU.  Note that if the --cpu parameter is used to limit which specific CPUs are displayed, turbostat will still collect statistics for all CPUs in the system and will still show the system summary for all CPUs in the system.
98 .SH COLUMN DESCRIPTIONS
99 .PP
100 \fBusec\fP For each CPU, the number of microseconds elapsed during counter collection, including thread migration -- if any.  This counter is disabled by default, and is enabled with "--enable usec", or --debug.  On the summary row, usec refers to the total elapsed time to collect the counters on all cpus.
101 .PP
102 \fBTime_Of_Day_Seconds\fP For each CPU, the gettimeofday(2) value (seconds.subsec since Epoch) when the counters ending the measurement interval were collected.  This column is disabled by default, and can be enabled with "--enable Time_Of_Day_Seconds" or "--debug".  On the summary row, Time_Of_Day_Seconds refers to the timestamp following collection of counters on the last CPU.
103 .PP
104 \fBCore\fP processor core number.  Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology (HT).
105 .PP
106 \fBCPU\fP Linux CPU (logical processor) number.  Yes, it is okay that on many systems the CPUs are not listed in numerical order -- for efficiency reasons, turbostat runs in topology order, so HT siblings appear together.
107 .PP
108 \fBPackage\fP processor package number -- not present on systems with a single processor package.
109 .PP
110 \fBAvg_MHz\fP number of cycles executed divided by time elapsed.  Note that this includes idle-time when 0 instructions are executed.
111 .PP
112 \fBBusy%\fP percent of the measurement interval that the CPU executes instructions, aka. % of time in "C0" state.
113 .PP
114 \fBBzy_MHz\fP average clock rate while the CPU was not idle (ie. in "c0" state).
115 .PP
116 \fBTSC_MHz\fP average MHz that the TSC ran during the entire interval.
117 .PP
118 \fBIRQ\fP The number of interrupts serviced by that CPU during the measurement interval.  The system total line is the sum of interrupts serviced across all CPUs.  turbostat parses /proc/interrupts to generate this summary.
119 .PP
120 \fBSMI\fP The number of System Management Interrupts  serviced CPU during the measurement interval.  While this counter is actually per-CPU, SMI are triggered on all processors, so the number should be the same for all CPUs.
121 .PP
122 \fBC1, C2, C3...\fP The number times Linux requested the C1, C2, C3 idle state during the measurement interval.  The system summary line shows the sum for all CPUs.  These are C-state names as exported in /sys/devices/system/cpu/cpu*/cpuidle/state*/name.  While their names are generic, their attributes are processor specific. They the system description section of output shows what MWAIT sub-states they are mapped to on each system.
123 .PP
124 \fBC1%, C2%, C3%\fP The residency percentage that Linux requested C1, C2, C3....  The system summary is the average of all CPUs in the system.  Note that these are software, reflecting what was requested.  The hardware counters reflect what was actually achieved.
125 .PP
126 \fBCPU%c1, CPU%c3, CPU%c6, CPU%c7\fP show the percentage residency in hardware core idle states.  These numbers are from hardware residency counters.
127 .PP
128 \fBCoreTmp\fP Degrees Celsius reported by the per-core Digital Thermal Sensor.
129 .PP
130 \fBPkgTmp\fP Degrees Celsius reported by the per-package Package Thermal Monitor.
131 .PP
132 \fBGFX%rc6\fP The percentage of time the GPU is in the "render C6" state, rc6, during the measurement interval. From /sys/class/drm/card0/power/rc6_residency_ms or /sys/class/drm/card0/gt/gt0/rc6_residency_ms or /sys/class/drm/card0/device/tile0/gtN/gtidle/idle_residency_ms depending on the graphics driver being used.
133 .PP
134 \fBGFXMHz\fP Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/graphics/fb0/device/drm/card0/gt_cur_freq_mhz or /sys/class/drm/card0/gt_cur_freq_mhz or /sys/class/drm/card0/gt/gt0/rps_cur_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/cur_freq depending on the graphics driver being used.
135 .PP
136 \fBGFXAMHz\fP Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/graphics/fb0/device/drm/card0/gt_act_freq_mhz or /sys/class/drm/card0/gt_act_freq_mhz or /sys/class/drm/card0/gt/gt0/rps_act_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/act_freq depending on the graphics driver being used.
137 .PP
138 \fBSAM%mc6\fP The percentage of time the SA Media is in the "module C6" state, mc6, during the measurement interval. From /sys/class/drm/card0/gt/gt1/rc6_residency_ms or /sys/class/drm/card0/device/tile0/gtN/gtidle/idle_residency_ms depending on the graphics driver being used.
139 .PP
140 \fBSAMMHz\fP Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/drm/card0/gt/gt1/rps_cur_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/cur_freq depending on the graphics driver being used.
141 .PP
142 \fBSAMAMHz\fP Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/drm/card0/gt/gt1/rps_act_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/act_freq depending on the graphics driver being used.
143 .PP
144 \fBPkg%pc2, Pkg%pc3, Pkg%pc6, Pkg%pc7\fP percentage residency in hardware package idle states.  These numbers are from hardware residency counters.
145 .PP
146 \fBPkgWatt\fP Watts consumed by the whole package.
147 .PP
148 \fBCorWatt\fP Watts consumed by the core part of the package.
149 .PP
150 \fBGFXWatt\fP Watts consumed by the Graphics part of the package -- available only on client processors.
151 .PP
152 \fBRAMWatt\fP Watts consumed by the DRAM DIMMS -- available only on server processors.
153 .PP
154 \fBPKG_%\fP percent of the interval that RAPL throttling was active on the Package.  Note that the system summary is the sum of the package throttling time, and thus may be higher than 100% on a multi-package system.  Note that the meaning of this field is model specific.  For example, some hardware increments this counter when RAPL responds to thermal limits, but does not increment this counter when RAPL responds to power limits.  Comparing PkgWatt and PkgTmp to system limits is necessary.
155 .PP
156 \fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
157 .PP
158 \fBUncMHz\fP per-package uncore MHz, instantaneous sample.
159 .PP
160 \fBUMHz1.0\fP per-package uncore MHz for domain=1 and fabric_cluster=0, instantaneous sample.  System summary is the average of all packages.
161 .SH TOO MUCH INFORMATION EXAMPLE
162 By default, turbostat dumps all possible information -- a system configuration header, followed by columns for all counters.
163 This is ideal for remote debugging, use the "--out" option to save everything to a text file, and get that file to the expert helping you debug.
164 .PP
165 When you are not interested in all that information, and there are several ways to see only what you want.  First the "--quiet" option will skip the configuration information, and turbostat will show only the counter columns.  Second, you can reduce the columns with the "--hide" and "--show" options.  If you use the "--show" option, then turbostat will show only the columns you list.  If you use the "--hide" option, turbostat will show all columns, except the ones you list.
166 .PP
167 To find out what columns are available for --show and --hide, the "--list" option is available.  Usually, the CATEGORY names above are used to refer to groups of counters.  Also, for convenience, the special string "sysfs" can be used to refer to all of the sysfs C-state counters at once:
168 .PP
169 .nf
170 sudo ./turbostat --show sysfs --quiet sleep 10
171 10.003837 sec
172         C1      C1E     C3      C6      C7s     C1%     C1E%    C3%     C6%     C7s%
173         4       21      2       2       459     0.14    0.82    0.00    0.00    98.93
174         1       17      2       2       130     0.00    0.02    0.00    0.00    99.80
175         0       0       0       0       31      0.00    0.00    0.00    0.00    99.95
176         2       1       0       0       52      1.14    6.49    0.00    0.00    92.21
177         1       2       0       0       52      0.00    0.08    0.00    0.00    99.86
178         0       0       0       0       71      0.00    0.00    0.00    0.00    99.89
179         0       0       0       0       25      0.00    0.00    0.00    0.00    99.96
180         0       0       0       0       74      0.00    0.00    0.00    0.00    99.94
181         0       1       0       0       24      0.00    0.00    0.00    0.00    99.84
182 .fi
183 .PP
184 .SH ONE SHOT COMMAND EXAMPLE
185 If turbostat is invoked with a command, it will fork that command
186 and output the statistics gathered after the command exits.
187 In this case, turbostat output goes to stderr, by default.
188 Output can instead be saved to a file using the --out option.
189 In this example, the "sleep 10" command is forked, and turbostat waits for it to complete before saving all statistics into "ts.out".  Note that "sleep 10" is not part of turbostat, but is simply an example of a command that turbostat can fork.  The "ts.out" file is what you want to edit in a very wide window, paste into a spreadsheet, or attach to a bugzilla entry.
190
191 .nf
192 [root@hsw]# ./turbostat -o ts.out sleep 10
193 [root@hsw]#
194 .fi
195
196 .SH PERIODIC INTERVAL EXAMPLE
197 Without a command to fork, turbostat displays statistics ever 5 seconds.
198 Periodic output goes to stdout, by default, unless --out is used to specify an output file.
199 The 5-second interval can be changed with the "-i sec" option.
200 .nf
201 sudo turbostat --quiet --show CPU,frequency
202         Core    CPU     Avg_MHz Busy%   Bzy_MHz TSC_MHz CPU%c7  UncMhz
203         -       -       524     12.48   4198    3096    74.53   3800
204         0       0       4       0.09    4081    3096    98.88   3800
205         0       4       1       0.02    4063    3096
206         1       1       2       0.06    4063    3096    99.60
207         1       5       2       0.05    4070    3096
208         2       2       4178    99.52   4199    3096    0.00
209         2       6       3       0.08    4159    3096
210         3       3       1       0.04    4046    3096    99.66
211         3       7       0       0.01    3989    3096
212         Core    CPU     Avg_MHz Busy%   Bzy_MHz TSC_MHz CPU%c7  UncMhz
213         -       -       525     12.52   4198    3096    74.54   3800
214         0       0       4       0.10    4051    3096    99.49   3800
215         0       4       2       0.04    3993    3096
216         1       1       3       0.07    4054    3096    99.56
217         1       5       4       0.10    4018    3096
218         2       2       4178    99.51   4199    3096    0.00
219         2       6       4       0.09    4143    3096
220         3       3       2       0.06    4026    3096    99.10
221         3       7       7       0.17    4074    3096
222 .fi
223 This example also shows the use of the --show option to show only the desired columns.
224
225 .SH SYSTEM CONFIGURATION INFORMATION EXAMPLE
226
227 By default, turbostat always dumps system configuration information
228 before taking measurements.  In the example above, "--quiet" is used
229 to suppress that output.  Here is an example of the configuration information:
230 .nf
231 turbostat version 2022.04.16 - Len Brown <lenb@kernel.org>
232 Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.18.0-rc6-00001-ge6891250e3b5 ...
233 CPUID(0): GenuineIntel 0x16 CPUID levels
234 CPUID(1): family:model:stepping 0x6:9e:9 (6:158:9) microcode 0xea
235 CPUID(0x80000000): max_extended_levels: 0x80000008
236 CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM
237 CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, No-HWPpkg, EPB
238 cpu7: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO)
239 CPUID(7): SGX
240 cpu7: MSR_IA32_FEATURE_CONTROL: 0x00000005 (Locked )
241 CPUID(0x15): eax_crystal: 2 ebx_tsc: 258 ecx_crystal_hz: 0
242 TSC: 3096 MHz (24000000 Hz * 258 / 2 / 1000000)
243 CPUID(0x16): base_mhz: 3100 max_mhz: 4200 bus_mhz: 100
244 cpu7: MSR_MISC_PWR_MGMT: 0x00401cc0 (ENable-EIST_Coordination DISable-EPB DISable-OOB)
245 RAPL: 5825 sec. Joule Counter Range, at 45 Watts
246 cpu7: MSR_PLATFORM_INFO: 0x80839f1011f00
247 8 * 100.0 = 800.0 MHz max efficiency frequency
248 31 * 100.0 = 3100.0 MHz base frequency
249 cpu7: MSR_IA32_POWER_CTL: 0x002c005d (C1E auto-promotion: DISabled)
250 cpu7: MSR_TURBO_RATIO_LIMIT: 0x2728292a
251 39 * 100.0 = 3900.0 MHz max turbo 4 active cores
252 40 * 100.0 = 4000.0 MHz max turbo 3 active cores
253 41 * 100.0 = 4100.0 MHz max turbo 2 active cores
254 42 * 100.0 = 4200.0 MHz max turbo 1 active cores
255 cpu7: MSR_CONFIG_TDP_NOMINAL: 0x0000001f (base_ratio=31)
256 cpu7: MSR_CONFIG_TDP_LEVEL_1: 0x00000000 ()
257 cpu7: MSR_CONFIG_TDP_LEVEL_2: 0x00000000 ()
258 cpu7: MSR_CONFIG_TDP_CONTROL: 0x80000000 ( lock=1)
259 cpu7: MSR_TURBO_ACTIVATION_RATIO: 0x00000000 (MAX_NON_TURBO_RATIO=0 lock=0)
260 cpu7: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008008 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked, pkg-cstate-limit=8 (unlimited))
261 Uncore Frequency pkg0 die0: 800 - 3900 MHz (800 - 3900 MHz)
262 /dev/cpu_dma_latency: 2000000000 usec (default)
263 current_driver: intel_idle
264 current_governor: menu
265 current_governor_ro: menu
266 cpu7: POLL: CPUIDLE CORE POLL IDLE
267 cpu7: C1: MWAIT 0x00
268 cpu7: C1E: MWAIT 0x01
269 cpu7: C3: MWAIT 0x10
270 cpu7: C6: MWAIT 0x20
271 cpu7: C7s: MWAIT 0x33
272 cpu7: C8: MWAIT 0x40
273 cpu7: C9: MWAIT 0x50
274 cpu7: C10: MWAIT 0x60
275 cpu7: cpufreq driver: intel_pstate
276 cpu7: cpufreq governor: performance
277 cpufreq intel_pstate no_turbo: 0
278 cpu7: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch)
279 cpu0: MSR_PM_ENABLE: 0x00000001 (HWP)
280 cpu0: MSR_HWP_CAPABILITIES: 0x01101f53 (high 83 guar 31 eff 16 low 1)
281 cpu0: MSR_HWP_REQUEST: 0x00005353 (min 83 max 83 des 0 epp 0x0 window 0x0 pkg 0x0)
282 cpu0: MSR_HWP_INTERRUPT: 0x00000001 (EN_Guaranteed_Perf_Change, Dis_Excursion_Min)
283 cpu0: MSR_HWP_STATUS: 0x00000004 (No-Guaranteed_Perf_Change, No-Excursion_Min)
284 cpu0: EPB: 6 (balanced)
285 cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
286 cpu0: MSR_PKG_POWER_INFO: 0x00000168 (45 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
287 cpu0: MSR_PKG_POWER_LIMIT: 0x42820800218208 (UNlocked)
288 cpu0: PKG Limit #1: ENabled (65.000 Watts, 64.000000 sec, clamp ENabled)
289 cpu0: PKG Limit #2: ENabled (65.000 Watts, 0.002441* sec, clamp DISabled)
290 cpu0: MSR_VR_CURRENT_CONFIG: 0x00000000
291 cpu0: PKG Limit #4: 0.000000 Watts (UNlocked)
292 cpu0: MSR_DRAM_POWER_LIMIT: 0x5400de00000000 (UNlocked)
293 cpu0: DRAM Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
294 cpu0: MSR_PP0_POLICY: 0
295 cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
296 cpu0: Cores Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
297 cpu0: MSR_PP1_POLICY: 0
298 cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
299 cpu0: GFX Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
300 cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) (100 default - 0 offset)
301 cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x88200800 (68 C)
302 cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C)
303 cpu7: MSR_PKGC3_IRTL: 0x0000884e (valid, 79872 ns)
304 cpu7: MSR_PKGC6_IRTL: 0x00008876 (valid, 120832 ns)
305 cpu7: MSR_PKGC7_IRTL: 0x00008894 (valid, 151552 ns)
306 cpu7: MSR_PKGC8_IRTL: 0x000088fa (valid, 256000 ns)
307 cpu7: MSR_PKGC9_IRTL: 0x0000894c (valid, 339968 ns)
308 cpu7: MSR_PKGC10_IRTL: 0x00008bf2 (valid, 1034240 ns)
309 .fi
310 .PP
311 The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
312 available at the minimum package voltage.  The \fBTSC frequency\fP is the base
313 frequency of the processor -- this should match the brand string
314 in /proc/cpuinfo.  This base frequency
315 should be sustainable on all CPUs indefinitely, given nominal power and cooling.
316 The remaining rows show what maximum turbo frequency is possible
317 depending on the number of idle cores.  Note that not all information is
318 available on all processors.
319 .SH ADD COUNTER EXAMPLE
320 Here we limit turbostat to showing just the CPU number for cpu0 - cpu3.
321 We add a counter showing the 32-bit raw value of MSR 0x199 (MSR_IA32_PERF_CTL),
322 labeling it with the column header, "PRF_CTRL", and display it only once,
323 afte the conclusion of a 0.1 second sleep.
324 .nf
325 sudo ./turbostat --quiet --cpu 0-3 --show CPU --add msr0x199,u32,raw,PRF_CTRL sleep .1
326 0.101604 sec
327 CPU       PRF_CTRL
328 -       0x00000000
329 0       0x00000c00
330 1       0x00000800
331 2       0x00000a00
332 3       0x00000800
333
334 .fi
335
336 .SH INPUT
337
338 For interval-mode, turbostat will immediately end the current interval
339 when it sees a newline on standard input.
340 turbostat will then start the next interval.
341 Control-C will be send a SIGINT to turbostat,
342 which will immediately abort the program with no further processing.
343 .SH SIGNALS
344
345 SIGINT will interrupt interval-mode.
346 The end-of-interval data will be collected and displayed before turbostat exits.
347
348 SIGUSR1 will end current interval,
349 end-of-interval data will be collected and displayed before turbostat
350 starts a new interval.
351 .SH NOTES
352
353 .B "turbostat "
354 must be run as root.
355 Alternatively, non-root users can be enabled to run turbostat this way:
356
357 # setcap cap_sys_admin,cap_sys_rawio,cap_sys_nice=+ep path/to/turbostat
358
359 # chmod +r /dev/cpu/*/msr
360
361 # chmod +r /dev/cpu_dma_latency
362
363 .B "turbostat "
364 reads hardware counters, but doesn't write them.
365 So it will not interfere with the OS or other programs, including
366 multiple invocations of itself.
367
368 \fBturbostat \fP
369 may work poorly on Linux-2.6.20 through 2.6.29,
370 as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF MSRs
371 in those kernels.
372
373 AVG_MHz = APERF_delta/measurement_interval.  This is the actual
374 number of elapsed cycles divided by the entire sample interval --
375 including idle time.  Note that this calculation is resilient
376 to systems lacking a non-stop TSC.
377
378 TSC_MHz = TSC_delta/measurement_interval.
379 On a system with an invariant TSC, this value will be constant
380 and will closely match the base frequency value shown
381 in the brand string in /proc/cpuinfo.  On a system where
382 the TSC stops in idle, TSC_MHz will drop
383 below the processor's base frequency.
384
385 Busy% = MPERF_delta/TSC_delta
386
387 Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
388
389 Note that these calculations depend on TSC_delta, so they
390 are not reliable during intervals when TSC_MHz is not running at the base frequency.
391
392 Turbostat data collection is not atomic.
393 Extremely short measurement intervals (much less than 1 second),
394 or system activity that prevents turbostat from being able
395 to run on all CPUS to quickly collect data, will result in
396 inconsistent results.
397
398 The APERF, MPERF MSRs are defined to count non-halted cycles.
399 Although it is not guaranteed by the architecture, turbostat assumes
400 that they count at TSC rate, which is true on all processors tested to date.
401
402 .SH REFERENCES
403 Volume 3B: System Programming Guide"
404 https://www.intel.com/products/processor/manuals/
405
406 .SH FILES
407 .ta
408 .nf
409 /dev/cpu/*/msr
410 .fi
411
412 .SH "SEE ALSO"
413 msr(4), vmstat(8)
414 .PP
415 .SH AUTHOR
416 .nf
417 Written by Len Brown <len.brown@intel.com>