Turbostat 2024.05.10 update since 2024.04.08:

Survive sparse die id's seen in Linux-6.9.
 
 Handle clustered-uncore topology in new/upcoming hardware.
 
 For non-root use, add ability to see software C-state counters.
 
 Enable reading core and package hardware cstate via perf,
 and prefer perf over the MSR driver access for these counters.
 -----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEE67dNfPFP+XUaA73mB9BFOha3NhcFAmZFaXAUHGxlbi5icm93
 bkBpbnRlbC5jb20ACgkQB9BFOha3NheYUQ//TwXL3Tc0LzontUz478jyPskHwylv
 cXk7eGrdQthYQhPUvY8BWei9j8RBZBIke8n1GE7oHH7BHuGbn68BkH+QOqN4B+sA
 n4uJ8JUJYXlfFrcUDGJoHXZn5AWhSKlJUV7jcZXijyuEdZsqisJf4kubSeBlzJRg
 hLFk9uDh+m3+WTiQZliY7Kfx8TRVnXlqHTodB3behmE9Q8NmRVZ0xxAiS129giLk
 t/nI5j/EP5tDRLZDn//ozrkQydRa8Oxp82pOwo2cUkKGMfwV3Ee9b959laQ1omEO
 lfZxEJI0Tw5v0R6wejrZPZhv/p9yH8vspCNf7zaKgiFwjmhg+Afjv8R7eH6FwGOY
 cr4KlzjIcYM8ZWHyz5pttHo2hOZnTxDHdXHXXXXZ0do5+f4+onyyUqRvdslZST/b
 z+4+FBIQGkt0m9ToONvZuNuqBepNhd4Sh4aV2sNpT8zvmS1aSWw77Ts7apefCthI
 +/HU8HYd5/+8pg5vsBxFM6i39ekV3TPftjfrT7hbYFab8VFehXeC2rmUotwkZlWq
 CYyCVl3IvaVNlw23fib+uMpjrEL+gotOT1Ol130/ahIfb0hD5clkPD6X1D5hOkhX
 5jZ9EizmXi4Mwqsdep513vCsfqT9M0FCG3f+gIQcYiW4GpuGAj8PFGMbWIaqwL77
 6PLw9rdlIkDVDMw=
 =7ZNt
 -----END PGP SIGNATURE-----

Merge tag 'turbostat-for-Linux-6.10-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

Pull turbostat updates from Len Brown:

 - Survive sparse die id's seen in Linux-6.9

 - Handle clustered-uncore topology in new/upcoming hardware

 - For non-root use, add ability to see software C-state counters

 - Enable reading core and package hardware cstate via perf, and prefer
   perf over the MSR driver access for these counters

* tag 'turbostat-for-Linux-6.10-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
  tools/power turbostat: version 2024.05.10
  tools/power turbostat: Ignore pkg_cstate_limit when it is not available
  tools/power turbostat: Fix order of strings in pkg_cstate_limit_strings
  tools/power turbostat: Read Package-cstates via perf
  tools/power turbostat: Read Core-cstates via perf
  tools/power turbostat: Avoid possible memory corruption due to sparse topology IDs
  tools/power turbostat: Add columns for clustered uncore frequency
  tools/power turbostat: Enable non-privileged users to read sysfs counters
  tools/power turbostat: Replace _Static_assert with BUILD_BUG_ON
  tools/power turbostat: Add ARL-H support
  tools/power turbostat: Enhance ARL/LNL support
  tools/power turbostat: Survive sparse die_id
  tools/power turbostat: Remember global max_die_id
  tools/power turbostat: Harden probe_intel_uncore_frequency()
  tools/power turbostat: Add "snapshot:" Makefile target
This commit is contained in:
Linus Torvalds 2024-05-19 12:33:28 -07:00
commit a90f1cd105
3 changed files with 908 additions and 310 deletions

View file

@ -3,6 +3,8 @@ CC = $(CROSS_COMPILE)gcc
BUILD_OUTPUT := $(CURDIR)
PREFIX ?= /usr
DESTDIR ?=
DAY := $(shell date +%Y.%m.%d)
SNAPSHOT = turbostat-$(DAY)
ifeq ("$(origin O)", "command line")
BUILD_OUTPUT := $(O)
@ -22,9 +24,30 @@ override CFLAGS += -D_FORTIFY_SOURCE=2
.PHONY : clean
clean :
@rm -f $(BUILD_OUTPUT)/turbostat
@rm -f $(SNAPSHOT).tar.gz
install : turbostat
install -d $(DESTDIR)$(PREFIX)/bin
install -d $(DESTDIR)$(PREFIX)/bin
install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
install -d $(DESTDIR)$(PREFIX)/share/man/man8
install -d $(DESTDIR)$(PREFIX)/share/man/man8
install -m 644 turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8
snapshot: turbostat
@rm -rf $(SNAPSHOT)
@mkdir $(SNAPSHOT)
@cp turbostat Makefile turbostat.c turbostat.8 ../../../../arch/x86/include/asm/intel-family.h $(SNAPSHOT)
@sed -e 's/^#include <linux\/bits.h>/#include "bits.h"/' ../../../../arch/x86/include/asm/msr-index.h > $(SNAPSHOT)/msr-index.h
@echo '#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))' >> $(SNAPSHOT)/msr-index.h
@echo "#define BIT(x) (1 << (x))" > $(SNAPSHOT)/bits.h
@echo "#define BIT_ULL(nr) (1ULL << (nr))" >> $(SNAPSHOT)/bits.h
@echo "#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h
@echo "#define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h
@echo PWD=. > $(SNAPSHOT)/Makefile
@echo "CFLAGS += -DMSRHEADER='\"msr-index.h\"'" >> $(SNAPSHOT)/Makefile
@echo "CFLAGS += -DINTEL_FAMILY_HEADER='\"intel-family.h\"'" >> $(SNAPSHOT)/Makefile
@sed -e's/.*MSRHEADER.*//' -e's/.*INTEL_FAMILY_HEADER.*//' Makefile >> $(SNAPSHOT)/Makefile
@rm -f $(SNAPSHOT).tar.gz
tar cvzf $(SNAPSHOT).tar.gz $(SNAPSHOT)

View file

@ -155,7 +155,9 @@ The system configuration dump (if --quiet is not used) is followed by statistics
.PP
\fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
.PP
\fBUncMHz\fP uncore MHz, instantaneous sample.
\fBUncMHz\fP per-package uncore MHz, instantaneous sample.
.PP
\fBUMHz1.0\fP per-package uncore MHz for domain=1 and fabric_cluster=0, instantaneous sample. System summary is the average of all packages.
.SH TOO MUCH INFORMATION EXAMPLE
By default, turbostat dumps all possible information -- a system configuration header, followed by columns for all counters.
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.

File diff suppressed because it is too large Load diff