Skip to content

Commit 67469b8

Browse files
committed
Merge: Update turbostat to upstream version 2025.02.02
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6618 JIRA: https://issues.redhat.com/browse/RHEL-45097 JIRA: https://issues.redhat.com/browse/RHEL-47460 JIRA: https://issues.redhat.com/browse/RHEL-84464 Signed-off-by: David Arcari <[email protected]> Approved-by: Lenny Szubowicz <[email protected]> Approved-by: Steve Best <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Augusto Caringi <[email protected]>
2 parents 201242e + c7cdc6a commit 67469b8

File tree

2 files changed

+891
-228
lines changed

2 files changed

+891
-228
lines changed

tools/power/x86/turbostat/turbostat.8

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ name as necessary to disambiguate it from others is necessary. Note that option
3333
msr0xXXX is a hex offset, eg. msr0x10
3434
/sys/path... is an absolute path to a sysfs attribute
3535
<device> is a perf device from /sys/bus/event_source/devices/<device> eg. cstate_core
36+
On Intel hybrid platforms, instead of one "cpu" perf device there are two, "cpu_core" and "cpu_atom" devices for P and E cores respectively.
37+
Turbostat, in this case, allow user to use "cpu" device and will automatically detect the type of a CPU and translate it to "cpu_core" and "cpu_atom" accordingly.
38+
For a complete example see "ADD PERF COUNTER EXAMPLE #2 (using virtual "cpu" device)".
3639
<event> is a perf event for given device from /sys/bus/event_source/devices/<device>/events/<event> eg. c1-residency
3740
perf/cstate_core/c1-residency would then use /sys/bus/event_source/devices/cstate_core/events/c1-residency
3841

@@ -133,7 +136,7 @@ displays the statistics gathered since it was forked.
133136
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.
134137
.SH COLUMN DESCRIPTIONS
135138
.PP
136-
\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.
139+
\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 snapshot the procfs/sysfs and collect the counters on all cpus.
137140
.PP
138141
\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.
139142
.PP
@@ -187,6 +190,8 @@ The system configuration dump (if --quiet is not used) is followed by statistics
187190
.PP
188191
\fBRAMWatt\fP Watts consumed by the DRAM DIMMS -- available only on server processors.
189192
.PP
193+
\fBSysWatt\fP Watts consumed by the whole platform (RAPL PSYS).
194+
.PP
190195
\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.
191196
.PP
192197
\fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
@@ -387,6 +392,28 @@ CPU pCPU%c1 CPU%c1
387392

388393
.fi
389394

395+
.SH ADD PERF COUNTER EXAMPLE #2 (using virtual cpu device)
396+
Here we run on hybrid, Raptor Lake platform.
397+
We limit turbostat to show output for just cpu0 (pcore) and cpu12 (ecore).
398+
We add a counter showing number of L3 cache misses, using virtual "cpu" device,
399+
labeling it with the column header, "VCMISS".
400+
We add a counter showing number of L3 cache misses, using virtual "cpu_core" device,
401+
labeling it with the column header, "PCMISS". This will fail on ecore cpu12.
402+
We add a counter showing number of L3 cache misses, using virtual "cpu_atom" device,
403+
labeling it with the column header, "ECMISS". This will fail on pcore cpu0.
404+
We display it only once, after the conclusion of 0.1 second sleep.
405+
.nf
406+
sudo ./turbostat --quiet --cpu 0,12 --show CPU --add perf/cpu/cache-misses,cpu,delta,raw,VCMISS --add perf/cpu_core/cache-misses,cpu,delta,raw,PCMISS --add perf/cpu_atom/cache-misses,cpu,delta,raw,ECMISS sleep .1
407+
turbostat: added_perf_counters_init_: perf/cpu_atom/cache-misses: failed to open counter on cpu0
408+
turbostat: added_perf_counters_init_: perf/cpu_core/cache-misses: failed to open counter on cpu12
409+
0.104630 sec
410+
CPU ECMISS PCMISS VCMISS
411+
- 0x0000000000000000 0x0000000000000000 0x0000000000000000
412+
0 0x0000000000000000 0x0000000000007951 0x0000000000007796
413+
12 0x000000000001137a 0x0000000000000000 0x0000000000011392
414+
415+
.fi
416+
390417
.SH ADD PMT COUNTER EXAMPLE
391418
Here we limit turbostat to showing just the CPU number 0.
392419
We add two counters, showing crystal clock count and the DC6 residency.
@@ -489,14 +516,40 @@ that they count at TSC rate, which is true on all processors tested to date.
489516
Volume 3B: System Programming Guide"
490517
https://www.intel.com/products/processor/manuals/
491518

519+
.SH RUN THE LATEST VERSION
520+
If turbostat complains that it doesn't recognize your processor,
521+
please try the latest version.
522+
523+
The latest version of turbostat does not require the latest version of the Linux kernel.
524+
However, some features, such as perf(1) counters, do require kernel support.
525+
526+
The latest turbostat release is available in the upstream Linux Kernel source tree.
527+
eg. "git pull https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
528+
and run make in tools/power/x86/turbostat/.
529+
530+
n.b. "make install" will update your system manually, but a distro update may subsequently downgrade your turbostat to an older version.
531+
For this reason, manually installing to /usr/local/bin may be what you want.
532+
533+
Note that turbostat/Makefile has a "make snapshot" target, which will create a tar file
534+
that can build without a local kernel source tree.
535+
536+
If the upstream version isn't new enough, the development tree can be found here:
537+
"git pull https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git turbostat"
538+
539+
If the development tree doesn't work, please contact the author via chat,
540+
or via email with the word "turbostat" on the Subject line.
541+
492542
.SH FILES
493543
.ta
494544
.nf
545+
/sys/bus/event_source/devices/
495546
/dev/cpu/*/msr
547+
/sys/class/intel_pmt/
548+
/sys/devices/system/cpu/
496549
.fi
497550

498551
.SH "SEE ALSO"
499-
msr(4), vmstat(8)
552+
perf(1), msr(4), vmstat(8)
500553
.PP
501554
.SH AUTHOR
502555
.nf

0 commit comments

Comments
 (0)