Skip to content

Commit a90f1cd

Browse files
committed
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
2 parents a760562 + 256d218 commit a90f1cd

File tree

3 files changed

+899
-301
lines changed

3 files changed

+899
-301
lines changed

tools/power/x86/turbostat/Makefile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ CC = $(CROSS_COMPILE)gcc
33
BUILD_OUTPUT := $(CURDIR)
44
PREFIX ?= /usr
55
DESTDIR ?=
6+
DAY := $(shell date +%Y.%m.%d)
7+
SNAPSHOT = turbostat-$(DAY)
68

79
ifeq ("$(origin O)", "command line")
810
BUILD_OUTPUT := $(O)
@@ -22,9 +24,30 @@ override CFLAGS += -D_FORTIFY_SOURCE=2
2224
.PHONY : clean
2325
clean :
2426
@rm -f $(BUILD_OUTPUT)/turbostat
27+
@rm -f $(SNAPSHOT).tar.gz
2528

2629
install : turbostat
27-
install -d $(DESTDIR)$(PREFIX)/bin
30+
install -d $(DESTDIR)$(PREFIX)/bin
2831
install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
29-
install -d $(DESTDIR)$(PREFIX)/share/man/man8
32+
install -d $(DESTDIR)$(PREFIX)/share/man/man8
3033
install -m 644 turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8
34+
35+
snapshot: turbostat
36+
@rm -rf $(SNAPSHOT)
37+
@mkdir $(SNAPSHOT)
38+
@cp turbostat Makefile turbostat.c turbostat.8 ../../../../arch/x86/include/asm/intel-family.h $(SNAPSHOT)
39+
40+
@sed -e 's/^#include <linux\/bits.h>/#include "bits.h"/' ../../../../arch/x86/include/asm/msr-index.h > $(SNAPSHOT)/msr-index.h
41+
@echo '#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))' >> $(SNAPSHOT)/msr-index.h
42+
@echo "#define BIT(x) (1 << (x))" > $(SNAPSHOT)/bits.h
43+
@echo "#define BIT_ULL(nr) (1ULL << (nr))" >> $(SNAPSHOT)/bits.h
44+
@echo "#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h
45+
@echo "#define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h
46+
47+
@echo PWD=. > $(SNAPSHOT)/Makefile
48+
@echo "CFLAGS += -DMSRHEADER='\"msr-index.h\"'" >> $(SNAPSHOT)/Makefile
49+
@echo "CFLAGS += -DINTEL_FAMILY_HEADER='\"intel-family.h\"'" >> $(SNAPSHOT)/Makefile
50+
@sed -e's/.*MSRHEADER.*//' -e's/.*INTEL_FAMILY_HEADER.*//' Makefile >> $(SNAPSHOT)/Makefile
51+
52+
@rm -f $(SNAPSHOT).tar.gz
53+
tar cvzf $(SNAPSHOT).tar.gz $(SNAPSHOT)

tools/power/x86/turbostat/turbostat.8

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ The system configuration dump (if --quiet is not used) is followed by statistics
155155
.PP
156156
\fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
157157
.PP
158-
\fBUncMHz\fP uncore MHz, instantaneous sample.
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.
159161
.SH TOO MUCH INFORMATION EXAMPLE
160162
By default, turbostat dumps all possible information -- a system configuration header, followed by columns for all counters.
161163
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.

0 commit comments

Comments
 (0)