Skip to content

sync turbostat to release 2025.12.02 - #138

Open
zhang-rui wants to merge 251 commits into
6.6-velinuxfrom
intel-turbostat-dmr-6.6
Open

zhang-rui wants to merge 251 commits into
6.6-velinuxfrom
intel-turbostat-dmr-6.6

Conversation

@zhang-rui

@zhang-rui zhang-rui commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

sync turbostat to release 2025.12.02 including DMR support

Test:
Tested with: lkvs:bm:turbostat:tests

On CWF/SRF:
Regression (1 test):
lkvs:bm:turbostat:tests:hotplug_cycle
Symptom: die() is called by turbostat_tests.sh:163:hotplug_cycle()
This is a known gap in upstream kernel that turbostat not work properly in fork_it mode when a CPU hotplug happens when command running.
No improvement observed.

On DMR:
Regression (1 test):
lkvs:bm:turbostat:tests:hotplug_cycle
Symptom: die() is called by turbostat_tests.sh:163:hotplug_cycle()
Improvement:
Turbostat has real platform support and started to expose platform specific counters like Pkg%pc2, etc.

1: tools/power/turbostat: Fix failure with new uncore sysfs
2: tools/power/turbostat: Enable TCC Offset on more models
3: tools/power/turbostat: Support alternative graphics sysfs knobs
4: tools/power/turbostat: Replace raw value cpu model with Macro
5: tools/power/turbostat: Remove redundant duplicates
6: tools/power/turbostat: Remove pseudo check for two models
7: tools/power/turbostat: Add skeleton support for table driven feature enumeration
8: tools/power/turbostat: Abstract MSR_MISC_FEATURE_CONTROL support
9: tools/power/turbostat: Abstract MSR_MISC_PWR_MGMT support
10: tools/power/turbostat: Abstract BCLK frequency support
11: tools/power/turbostat: Abstract Package cstate limit decoding support
12: tools/power/turbostat: Abstract Nehalem MSRs support
13: tools/power/turbostat: Remove a redundant check
14: tools/power/turbostat: Rename some functions
15: tools/power/turbostat: Abstract Turbo Ratio Limit MSRs support
16: tools/power/turbostat: Rename some TRL functions
17: tools/power/turbostat: Abstract Config TDP MSRs support
18: tools/power/turbostat: Abstract TCC Offset bits support
19: tools/power/turbostat: Abstract Perf Limit Reasons MSRs support
20: tools/power/turbostat: Abstract Automatic Cstate Conversion support
21: tools/power/turbostat: Abstract hardcoded Crystal Clock frequency
22: tools/power/turbostat: Redefine RAPL macros
23: tools/power/turbostat: Simplify the logic for RAPL enumeration
24: tools/power/turbostat: Abstract RAPL MSRs support
25: tools/power/turbostat: Abstract Per Core RAPL support
26: tools/power/turbostat: Abstract RAPL divisor support
27: tools/power/turbostat: Abstract fixed DRAM Energy unit support
28: tools/power/turbostat: Abstract hardcoded TDP value
29: tools/power/turbostat: Remove unused family/model parameters for RAPL functions
30: tools/power/turbostat: Abstract TSC tweak support
31: tools/power/turbostat: Add skeleton support for cstate enumeration
32: tools/power/turbostat: Adjust cstate for models with .has_nhm_msrs set
33: tools/power/turbostat: Adjust cstate for has_snb_msrs() models
34: tools/power/turbostat: Adjust cstate for models with .cst_limit set
35: tools/power/turbostat: Adjust cstate for has_snb_msrs() models
36: tools/power/turbostat: Adjust cstate for has_slv_msrs() models
37: tools/power/turbostat: Adjust cstate for is_jvl() models
38: tools/power/turbostat: Adjust cstate for is_dnv() models
39: tools/power/turbostat: Adjust cstate for is_skx()/is_icx()/is_spr() models
40: tools/power/turbostat: Adjust cstate for is_bdx() models
41: tools/power/turbostat: Adjust cstate for has_c8910_msrs() models
42: tools/power/turbostat: Adjust cstate for is_slm()/is_knl()/is_cnl()/is_ehl() models
43: tools/power/turbostat: Use fine grained IRTL output
44: tools/power/turbostat: Abstract IRTL support
45: tools/power/turbostat: Abstract MSR_CORE_C1_RES support
46: tools/power/turbostat: Abstract MSR_MODULE_C6_RES_MS support
47: tools/power/turbostat: Abstract MSR_CC6/MC6_DEMOTION_POLICY_CONFIG support
48: tools/power/turbostat: Abstract MSR_ATOM_PKG_C6_RESIDENCY support
49: tools/power/turbostat: Abstract MSR_KNL_CORE_C6_RESIDENCY support
50: tools/power/turbostat: Abstract extended cstate MSRs support
51: tools/power/turbostat: Abstract aperf/mperf multiplier support
52: tools/power/turbostat: Abstract cstate prewake bit support
53: tools/power/turbostat: Delete intel_model_duplicates()
54: tools/power/turbostat: Improve probe_platform_features() logic
55: tools/power/turbostat: Relocate cstate probing code
56: tools/power/turbostat: Relocate pstate probing code
57: tools/power/turbostat: Rename uncore probing function
58: tools/power/turbostat: Rename rapl probing function
59: tools/power/turbostat: Relocate graphics probing code
60: tools/power/turbostat: Relocate lpi probing code
61: tools/power/turbostat: Relocate thermal probing code
62: tools/power/turbostat: Reorder some functions
63: tools/power/turbostat: Relocate more probing related code
64: tools/power/turbostat: Introduce probe_pm_features()
65: tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platforms
66: tools/power/turbostat: Remove PC7/PC9 support on ADL/RPL
67: tools/power/turbostat: Introduce cpu_allowed_set
68: tools/power/turbostat: Obey allowed CPUs when accessing CPU counters
69: tools/power/turbostat: Obey allowed CPUs during startup
70: tools/power/turbostat: Abstract several functions
71: tools/power/turbostat: Obey allowed CPUs for primary thread/core detection
72: tools/power/turbostat: Obey allowed CPUs for system summary
73: tools/power/turbostat: Handle offlined CPUs in cpu_subset
74: tools/power/turbostat: Abstrct function for parsing cpu string
75: tools/power/turbostat: Handle cgroup v2 cpu limitation
76: tools/power/turbostat: Move process to root cgroup
77: tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_features
78: tools/power/turbostat: Add initial support for GraniteRapids
79: tools/power/turbostat: Add initial support for SierraForest
80: tools/power/turbostat: Add initial support for GrandRidge
81: tools/power/turbostat: Add initial support for ArrowLake
82: tools/power/turbostat: Add initial support for LunarLake
83: tools/power/turbostat: bugfix "--show IPC"
84: tools/power turbostat: version 2023.11.07
85: tools/power turbostat: Do not print negative LPI residency
86: tools/power turbostat: Expand probe_intel_uncore_frequency()
87: tools/power turbostat: Read base_hz and bclk from CPUID.16H if available
88: tools/power turbostat: enhance -D (debug counter dump) output
89: tools/power turbostat: Add --no-msr option
90: tools/power turbostat: Add --no-perf option
91: tools/power turbostat: Add reading aperf and mperf via perf API
92: tools/power turbostat: detect and disable unavailable BICs at runtime
93: tools/power turbostat: add early exits for permission checks
94: tools/power turbostat: Clear added counters when in no-msr mode
95: tools/power turbostat: Add proper re-initialization for perf file descriptors
96: tools/power turbostat: read RAPL counters via perf
97: tools/power/turbostat: Enable MSR_CORE_C1_RES support for ICX
98: tools/power/turbostat: Cache graphics sysfs path
99: tools/power/turbostat: Unify graphics sysfs snapshots
100: tools/power/turbostat: Introduce BIC_SAM_mc6/BIC_SAMMHz/BIC_SAMACTMHz
101: tools/power/turbostat: Add support for new i915 sysfs knobs
102: tools/power/turbostat: Add support for Xe sysfs knobs
103: tools/power turbostat: v2024.04.10
104: tools/power turbostat: Add "snapshot:" Makefile target
105: tools/power turbostat: Harden probe_intel_uncore_frequency()
106: tools/power turbostat: Survive sparse die_id
107: tools/power turbostat: Enhance ARL/LNL support
108: tools/power turbostat: Add ARL-H support
109: tools/power turbostat: Replace Static_assert with BUILD_BUG_ON
110: tools/power turbostat: Enable non-privileged users to read sysfs counters
111: tools/power turbostat: Add columns for clustered uncore frequency
112: tools/power turbostat: Avoid possible memory corruption due to sparse topology IDs
113: tools/power turbostat: Read Core-cstates via perf
114: tools/power turbostat: Read Package-cstates via perf
115: tools/power turbostat: Fix order of strings in pkg_cstate_limit_strings
116: tools/power turbostat: Ignore pkg_cstate_limit when it is not available
117: tools/power turbostat: version 2024.05.10
118: tools/power turbostat: option '-n' is ambiguous
119: tools/power turbostat: Fix unc freq columns not showing with '-q' or '-l'
120: tools/power/turbostat: Switch to new Intel CPU model defines
121: tools/power turbostat: Add local build_bug.h header for snapshot target
122: tools/power turbostat: Remove anonymous union from rapl_counter_info_t
123: tools/power turbostat: Replace enum rapl_source and cstate_source with counter_source
124: tools/power turbostat: Add ZERO_ARRAY for zero initializing builtin array
125: tools/power turbostat: Group SMI counter with APERF and MPERF
126: tools/power turbostat: Extend --add option with perf counters
127: tools/power turbostat: Fix formatting in turbostat.8
128: tools/power turbostat: Add perf added counter example to turbostat.8
129: tools/power turbostat: Fix typo in turbostat.8
130: tools/power turbostat: Move debug prints from stdout to stderr
131: tools/power turbostat: Move verbose counter messages to level 2
132: tools/power turbostat: Add early support for PMT counters
133: tools/power turbostat: Add MTL's PMT DC6 builtin counter
134: tools/power turbostat: Document PMT in turbostat.8
135: tools/power turbostat: Include umask=%x in perf counter's config
136: tools/power turbostat: version 2024.07.26
137: tools/power turbostat: fix GCC9 build regression
138: tools/power turbostat: Fix column printing for PMT xtal_time counters
139: tools/power turbostat: Allow using cpu device in perf counters on hybrid platforms
140: tools/power turbostat: Fix trailing '\n' parsing
141: tools/power turbostat: Honor --show CPU, even when even when num_cpus=1
142: tools/power turbostat: Remove PC7/PC9 support on MTL
143: tools/power turbostat: Add back PC8 support on Arrowlake
144: tools/power turbostat: Rename arl_features to lnl_features
145: tools/power turbostat: Remove PC3 support on Lunarlake
146: tools/power turbostat: Add initial support for GraniteRapids-D
147: tools/power turbostat: Enhance platform divergence description
148: tools/power turbostat: Remove unnecessary fflush() call
149: tools/power turbostat: Consolidate graphics sysfs access
150: tools/power turbostat: Cache graphics sysfs file descriptors during probe
151: tools/power turbostat: Add support for /sys/class/drm/card1
152: tools/power turbostat: Force --no-perf in --dump mode
153: tools/power turbostat: Fix child's argument forwarding
154: tools/power turbostat: Add RAPL psys as a built-in counter
155: tools/power turbostat: 2024.11.30
156: tools/power turbostat: Add initial support for PantherLake
157: tools/power turbostat: Add initial support for ClearwaterForest
158: tools/power turbostat: update turbostat(8)
159: tools/power turbostat: Exit on unsupported Intel models
160: tools/power turbostat: Exit on unsupported Vendors
161: tools/power turbostat: Improve --help output
162: tools/power turbostat: Introduce --force parameter
163: tools/power turbostat: add Busy% to "show idle"
164: tools/power turbostat: Add an NMI column
165: tools/power turbostat: Remove SysWatt from DISABLED_BY_DEFAULT
166: tools/power turbostat: Fix PMT mmaped file size rounding
167: tools/power turbostat: Add fixed RAPL PSYS divisor for SPR
168: tools/power turbostat: Enhance turbostat self-performance visibility
169: tools/power turbostat: Check for non-zero value when MSR probing
170: tools/power turbostat: Return default value for unmapped PMT domains
171: tools/power turbostat: Extend PMT identification with a sequence number
172: tools/power turbostat: Add PMT directory iterator helper
173: tools/power turbostat: Allow mapping multiple PMT files with the same GUID
174: tools/power turbostat: Allow adding PMT counters directly by sysfs path
175: tools/power turbostat: version 2025.01.14
176: tools/power turbostat: Add tcore clock PMT type
177: tools/power turbostat: Fix forked child affinity regression
178: tools/power turbostat: Harden one-shot mode against cpu offline
179: tools/power turbostat: Add CPU%c1e BIC for CWF
180: tools/power turbostat: version 2025.02.02
181: x86/cpu: Fix #define name for Intel CPU model 0x5A
182: tools/power turbostat: Clustered Uncore MHz counters should honor show/hide options
183: tools/power turbostat: Allow Zero return value for some RAPL registers
184: tools/power turbostat: Fix names matching
185: tools/power turbostat: Add idle governor statistics reporting
186: tools/power turbostat: Increase CPU_SUBSET_MAXCPUS to 8192
187: tools/power turbostat: report CoreThr per measurement interval
188: tools/power turbostat: Document GNR UncMHz domain convention
189: tools/power turbostat: Restore GFX sysfs fflush() call
190: tools/power turbostat: re-factor sysfs code
191: tools/power turbostat: disable "cpuidle" invocation counters, by default
192: tools/power turbostat: v2025.05.06
193: tools/power turbostat.8: fix typo: idle_pct should be pct_idle
194: tools/power turbostat.8: pm_domain wording fix
195: tools/power turbostat: Add Android support for MSR device handling
196: tools/power turbostat: Fix RAPL_GFX_ALL typo
197: tools/power turbostat: Fix AMD package-energy reporting
198: tools/power turbostat: Always check rapl_joules flag
199: tools/power turbostat: Quit early for unsupported RAPL counters
200: tools/power turbostat: Remove add_rapl_perf_counter
()
201: tools/power turbostat: Remove add_cstate_perf_counter_()
202: tools/power turbostat: Remove add_msr_perf_counter_()
203: tools/power turbostat: Introduce add_msr_counter()
204: tools/power turbostat: Clean up add perf/msr counter logic
205: tools/power turbostat: Allow probing RAPL with platform_features->rapl_msrs cleared
206: tools/power turbostat: Avoid probing the same perf counters
207: tools/power turbostat: Dump RAPL sysfs info
208: tools/power turbostat: Add initial support for DMR
209: tools/power turbostat: Add initial support for BartlettLake
210: tools/power turbostat: version 2025.06.08
211: tools/power turbostat: regression fix: --show C1E%
212: x86/cpu: Add new Intel CPU model numbers for Wildcatlake and Novalake
213: tools/power turbostat: verify arguments to params --show and --hide
214: tools/power turbostat: Fix build with musl
215: tools/power turbostat: Handle cap_get_proc() ENOSYS
216: tools/power turbostat: Fix bogus SysWatt for forked program
217: tools/power turbostat.8: Document Totl%C0, Any%C0, GFX%C0, CPUGFX% columns
218: tools/power turbostat: Support more than 64 built-in-counters
219: tools/power turbostat: probe and display L3 cache topology
220: tools/power turbostat: delete GET_PKG()
221: tools/power turbostat: add format "average" for external attributes
222: tools/power turbostat: Fix DMR support
223: tools/power turbostat: standardize PER_THREAD_PARAMS
224: tools/power turbostat: Handle non-root legacy-uncore sysfs permissions
225: tools/power turbostat: version 2025.09.09
226: tools/power turbostat: Fix incorrect sorting of PMT telemetry
227: tools/power turbostat: Regression fix Uncore MHz printed in hex
228: tools/power turbostat: Add Wildcat Lake and Nova Lake support
229: tools/power turbostat: Refactor added column header printing
230: tools/power turbostat: Refactor added-counter value printing code
231: tools/power turbostat.8: Update example
232: tools/power turbostat: Refactor floating point printout code
233: tools/power turbostat: Remove dead code
234: tools/power turbostat: Add LLC stats
235: tools/power turbostat: Set per_cpu_msr_sum to NULL after free
236: tools/power turbostat: Add run-time MSR driver probe
237: tools/power turbostat: Validate RAPL MSRs for AWS Nitro Hypervisor
238: tools/power turbostat: Enhance perf probe
239: tools/power turbostat: Validate APERF access for VMWARE
240: tools/power turbostat: Print "nan" for out of range percentages
241: tools/power turbostat: Print percentages in 8-columns
242: tools/power turbostat: Print wide names only for RAW 64-bit columns
243: tools/power turbostat: version 2025.12.02
244: tools/power turbostat: AMD: msr offset 0x611 read failed: Input/output error
245: tools/power turbostat: Harden against unexpected values
246: tools/power turbostat: Fix swidle header vs data display
247: tools/power/turbostat: Fix microcode patch level output for AMD/Hygon
248: tools/power turbostat: Fix incorrect format variable
249: tools/power turbostat: Fix --show/--hide for individual cpuidle counters
250: tools/power turbostat: Fix delimiter bug in print functions
251: tools/power turbostat: Fix unrecognized option '-P'

commit b98a6d7 upstream.

All Models that duplicate INTEL_FAM6_CANNONLAKE_L support TCC Offset.
Enable this feature on all these models.

Delete obsolete model_orig.

Intel-SIG: commit b98a6d7 tools/power/turbostat: Enable TCC Offset on more models
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 2c019d6 upstream.

/sys/class/graphics/fb0/device/drm/card0/ and /sys/class/drm/card0/
point to the same device node.
But in some cases, one exists and the other one does not.

Prefer to use /sys/class/drm/card0/, and fall back to
/sys/class/graphics/fb0/device/drm/card0/.

This recovers the "GFXMHz" and "GFXAMHz" columns on some platforms like
a SPR server.

Intel-SIG: commit 2c019d6 tools/power/turbostat: Support alternative graphics sysfs knobs
Sync turbostat to version 2025.12.02

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 6d306d6 upstream.

Kernel already has
 #define INTEL_FAM6_NEHALEM_G	0x1F /* Auburndale / Havendale */

Use standard Macro for CPU Model instead of raw value.

Intel-SIG: commit 6d306d6 tools/power/turbostat: Replace raw value cpu model with Macro
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit bbfc33b upstream.

Remove redundant duplicates in intel_model_duplicates().

Intel-SIG: commit bbfc33b tools/power/turbostat: Remove redundant duplicates
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 48674c1 upstream.

INTEL_FAM6_ATOM_SILVERMONT_MID/INTEL_FAM6_ATOM_AIRMONT_MID are not
listed in probe_nhm_msrs(). This means that most of the turbostat
features are not available on these two platforms.

Further more, checking for these two models in has_slv_msrs() is
dead code. Because has_slv_msrs() is called by the code guarded by
probe_nhm_msrs().

For these two reasons, remove pseudo check for
INTEL_FAM6_ATOM_SILVERMONT_MID and INTEL_FAM6_ATOM_AIRMONT_MID.

Will add back the support when we can access these two platforms.

Intel-SIG: commit 48674c1 tools/power/turbostat: Remove pseudo check for two models
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
…enumeration

commit 45232ab upstream.

Turbostat supports a series of features that may diverge among different
CPU models.

Current code uses various of CPU model checks in different places to
handle this, which makes the code hard to maintain.

Add skeleton support for table driven feature enumeration to replace the
current error-prone CPU model checks and global variables.

Note: by comparing the CPU models with intel-family.h, it is found that
turbostat support for below four Models are missing, including
INTEL_FAM6_ICELAKE, INTEL_FAM6_ATOM_SILVERMONT_MID,
INTEL_FAM6_ATOM_AIRMONT_MID and INTEL_FAM6_ATOM_AIRMONT_NP. Adding
support for these models is a different work, thus it is not covered in
this patch set.

Intel-SIG: commit 45232ab tools/power/turbostat: Add skeleton support for table driven feature enumeration
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 778fc34 upstream.

Abstract MSR_MISC_FEATURE_CONTROL support.

Intel-SIG: commit 778fc34 tools/power/turbostat: Abstract MSR_MISC_FEATURE_CONTROL support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 3dd0e75 upstream.

Abstract MSR_MISC_PWR_MGMT support.

Intel-SIG: commit 3dd0e75 tools/power/turbostat: Abstract MSR_MISC_PWR_MGMT support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 71e8412 upstream.

Abstract CPU base clock frequency support.

Note that bclk is used by
1. calculate base_hz using MSR_PLATFORM_INFO, which is guarded by
   probe_nhm_msrs().
2. dump MSR_PLATFORM_INFO and Turbo Ratio Limit MSRs, which are also
   guarded by probe_nhm_msrs().
Thus probe_bclk() works for probe_nhm_msrs() models only.

Intel-SIG: commit 71e8412 tools/power/turbostat: Abstract BCLK frequency support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 3989fc8 upstream.

Abstract the support for decoding package cstate limit from
MSR_PKG_CST_CONFIG_CONTROL.

Intel-SIG: commit 3989fc8 tools/power/turbostat: Abstract Package cstate limit decoding support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit fcfa1ce upstream.

MSR_PLATFORM_INFO, MSR_IA32_TEMPERATURE_TARGET, MSR_SMI_COUNT,
MSR_PKG_CST_CONFIG_CONTROL, and the TRL MSRs are always available for
platforms since Nehalem. Support for these msrs can be described
altogether.

Abstract the support for these MSRs.

Delete probe_nhm_msrs() CPU model check.

Intel-SIG: commit fcfa1ce tools/power/turbostat: Abstract Nehalem MSRs support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit c2c25e8 upstream.

Platforms with has_msr_misc_pwr_mgmt set is a subset of platforms with
has_nhm_msrs set.

Thus remove the redudant check for platform->has_nhm_msrs.

Intel-SIG: commit c2c25e8 tools/power/turbostat: Remove a redundant check
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 8b7199c upstream.

Rename dump_nhm_platform_info() and dump_nhm_cst_cfg() to
dump_platform_info() and dump_cst_cfg() because these MSRs' behavior is
consistent when they're available.

Intel-SIG: commit 8b7199c tools/power/turbostat: Rename some functions
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 10d85d8 upstream.

Abstract the support for MSR_TURBO_RATIO_LIMIT, MSR_TRUBO_RATIO_LIMIT1,
MSR_TURBO_RATIO_LIMIT2, MSR_SECONDARY_TURBO_RATIO_LIMIT,
MSR_ATOM_CORE_RATIOS and MSR_ATOM_CORE_TURBO_RATIOS.

Delete has_turbo_ratio_group_limits(), has_turbo_ratio_limit(),
has_atom_turbo_ratio_limit(), has_ivt_turbo_ratio_limit(),
has_hsw_turbo_ratio_limit(), has_knl_turbo_ratio_limit() and
has_glm_turbo_ratio_limit() CPU model checks.

Intel-SIG: commit 10d85d8 tools/power/turbostat: Abstract Turbo Ratio Limit MSRs support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit a3943de upstream.

Rename dump_hsw_turbo_ratio_limits() and dump_ivt_turbo_ratio_limits()
to dump_turbo_ratio_limit2() and dump_turbo_ratio_limit1() because they
dump MSR_TURBO_RATIO_LIMIT1/LIMIT2, and the MSRs' behavior is
consistent when they are available.

Intel-SIG: commit a3943de tools/power/turbostat: Rename some TRL functions
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit a61c9cb upstream.

Abstract the support for MSR_CONFIG_TDP_NOMINAL/LEVEL_1/LEVEL_2/CONTROL
and MSR_TURBO_ACTIVATION_RATIO.

Delete has_config_tdp() CPU model check.

Intel-SIG: commit a61c9cb tools/power/turbostat: Abstract Config TDP MSRs support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit d8e1623 upstream.

Abstract the support for different TCC Offset bits in
MSR_IA32_TEMPERATURE_TARGET.

Delete check_tcc_offset() CPU model check.

Intel-SIG: commit d8e1623 tools/power/turbostat: Abstract TCC Offset bits support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 0c057cf upstream.

Abstract the support for MSR_CORE/GFX/RING_PERF_LIMIT_REASONS MSRs.

Delete perf_limit_reasons_probe() CPU model check.

Intel-SIG: commit 0c057cf tools/power/turbostat: Abstract Perf Limit Reasons MSRs support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit d90120b upstream.

Abstract the support for AUTOMATIC_CSTATE_CONVERSION bit in
MSR_PKG_CST_CONFIG_CONTROL.

Delete automatic_cstate_conversion_probe() CPU model check.

Intel-SIG: commit d90120b tools/power/turbostat: Abstract Automatic Cstate Conversion support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit a5d1ab9 upstream.

Abstract the support for hardcoded Crystal Clock frequency, which is
used when crystal clock is not available from CPUID.15.

Delete CPU model checks in process_cpuid().

Intel-SIG: commit a5d1ab9 tools/power/turbostat: Abstract hardcoded Crystal Clock frequency
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit b9cd668 upstream.

Redefine RAPL macros to make the code more readable.

Intel-SIG: commit b9cd668 tools/power/turbostat: Redefine RAPL macros
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit a98f886 upstream.

The support for each RAPL domains, as well as the support for the perf
status of each RAPL domains, can be detected by checking the
availabilities of the corresponding RAPL MSRs.

Change the code accordingly and remove the hardcoded logic for each
model.

Note that this also fixes the INTEL_FAM6_ATOM_TREMONT model, which has
RAPL_PKG_PERF_STATUS and MSR_DRAM_PERF_STATUS but doesn't have BIC_PKG__
and BIC_RAM__ set.

Intel-SIG: commit a98f886 tools/power/turbostat: Simplify the logic for RAPL enumeration
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 86ba263 upstream.

Abstract the support for RAPL MSRs.

Delete CPU model checks in rapl_probe_intel().

Intel-SIG: commit 86ba263 tools/power/turbostat: Abstract RAPL MSRs support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit e338831 upstream.

Abstract the support for Per Core RAPL.

Intel-SIG: commit e338831 tools/power/turbostat: Abstract Per Core RAPL support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 6d35b8c upstream.

INTEL_FAM6_ATOM_SILVERMONT model needs a divisor to convert the raw
Energy Units value from MSR_RAPL_POWER_UNIT.

Abstract the support for RAPL divisor.

Delete CPU model check in rapl_probe_intel().

Intel-SIG: commit 6d35b8c tools/power/turbostat: Abstract RAPL divisor support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 9e6f351 upstream.

Abstract the support for fixed Dram domain energy unit.

Delete rapl_dram_energy_units_probe() CPU model check.

Intel-SIG: commit 9e6f351 tools/power/turbostat: Abstract fixed DRAM Energy unit support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 7c60409 upstream.

Different hardcoded TDP values are used when TDP can not be retrieved
from the hardware.

Abstract hardcoded TDP value.

Delete CPU model checks in get_tdp_intel().

Intel-SIG: commit 7c60409 tools/power/turbostat: Abstract hardcoded TDP value
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
… functions

commit bf1ad57 upstream.

RAPL probing can be done without family/model checking. Remove these
parameters in rapl probe functions.

Intel-SIG: commit bf1ad57 tools/power/turbostat: Remove unused family/model parameters for RAPL functions
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 485a017 upstream.

On some models, the CPU base frequency is different from the TSC
frequency, and the aperf/mperf counters are running at CPU base
frequency instead of TSC frequency.

Abstract support for TSC tweak.

Given that tsc_tweak depends on base_hz, move the code to probe_bclk()
after base_hz is available.

Intel-SIG: commit 485a017 tools/power/turbostat: Abstract TSC tweak support
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 3c6a17b upstream.

Add skeleton support for cstate enumeration.

Note that the previous logic may override the cstate setting for
multiple times for different reasons. The conversion to new cstate
enumeration must be done step by step following the previous code
order strictly.

Intel-SIG: commit 3c6a17b tools/power/turbostat: Add skeleton support for cstate enumeration
Sync turbostat to version 2025.12.02

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
lenb and others added 28 commits August 7, 2026 12:22
commit e60a13bcef206795d3ddf82f130fe8f570176d06 upstream.

/sys/devices/system/cpu/intel_uncore_frequency/package_X_die_Y/
may be readable by all, but
/sys/devices/system/cpu/intel_uncore_frequency/package_X_die_Y/current_freq_khz
may be readable only by root.

Non-root turbostat users see complaints in this scenario.

Fail probe of the interface if we can't read current_freq_khz.

Reported-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Original-patch-by: Zhang Rui <rui.zhang@intel.com>

Intel-SIG: commit e60a13bcef20 tools/power turbostat: Handle non-root legacy-uncore sysfs permissions
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 5e98a5e73edcc4114c5ad10596db87e24f50ee4d upstream.

Probe and display L3 Cache topology
Add ability to average an added counter
	(useful for pre-integrated "counters", such as Watts)
Break the limit of 64 built-in counters.
Assorted bug fixes and minor feature tweaks

Intel-SIG: commit 5e98a5e73edc tools/power turbostat: version 2025.09.09
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit cafb47be3f38ad81306bf894e743bebc2ccf66ab upstream.

The pmt_telemdir_sort() comparison function was returning a boolean
value (0 or 1) instead of the required negative, zero, or positive
value for proper sorting. This caused unpredictable and incorrect
ordering of telemetry directories named telem0, telem1, ..., telemN.
Update the comparison logic to return -1, 0, or 1 based on the
numerical value extracted from the directory name, ensuring correct
numerical ordering when using scandir.

This change improves stability and correctness when iterating PMT
telemetry directories.

Intel-SIG: commit cafb47be3f38 tools/power turbostat: Fix incorrect sorting of PMT telemetry
Sync turbostat to version 2025.12.02

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 92664f2e6ab2228a3330734fc72dabeaf8a49ee1 upstream.

A patch to allow specifying FORMAT_AVERAGE to added counters...
broke the internally added counter for Cluster Uncore MHz -- printing it in HEX.

Intel-SIG: commit 92664f2e6ab2 tools/power turbostat: Regression fix Uncore MHz printed in hex
Sync turbostat to version 2025.12.02

Fixes: dcd1c379b0f1 ("tools/power turbostat: add format "average" for external attributes")
Reported-by: Andrej Tkalcec <andrej.tkalcec@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 4e35847d7b08e62e73b1636207f8c9074b4a4893 upstream.

Treat Wildcat Lake and Nova Lake (and Panther Lake)
the same as Lunar Lake, for now.

Intel-SIG: commit 4e35847d7b08 tools/power turbostat: Add Wildcat Lake and Nova Lake support
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 56dbb878507bf7a367103728318d7852c1c4ee71 upstream.

Over time, we built up many copies of nearly identical code...

Intel-SIG: commit 56dbb878507b tools/power turbostat: Refactor added column header printing
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 885e8227641604a6732cd5049f23ab39f80bee14 upstream.

We build up many copies of very similar code...

Intel-SIG: commit 885e82276416 tools/power turbostat: Refactor added-counter value printing code
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 64f96057a6391a643f4e7c2b2333c445acdec865 upstream.

Update the added-counters example to print counters in decimal
rather than hex -- now that it is working...

Intel-SIG: commit 64f96057a639 tools/power turbostat.8: Update example
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 696d15cbd8c2cf29a8e7486bf9fbf085f4cefed6 upstream.

Too many copies of (usually) the same printf code...

Also, unify code for added-counter FORMAT_AVERAGE,
which was correct where it was tested, but neglected elsewhere.

Intel-SIG: commit 696d15cbd8c2 tools/power turbostat: Refactor floating point printout code
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 6dfb04332f2391053d4cece0782637532fc75207 upstream.

amperf_group_fd is never used.

Intel-SIG: commit 6dfb04332f23 tools/power turbostat: Remove dead code
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 28a3ad1fd2abdf45357ffd46614a6129cd395ca3 upstream.

LLCkRPS = Last Level Cache Thousands of References Per Second
LLC%hit = Last Level Cache Hit %

These columns are enabled by-default.
They can be controlled with the --show/--hide options
by individual column names above,
or together using the "llc" or "cache" groups.

Intel-SIG: commit 28a3ad1fd2ab tools/power turbostat: Add LLC stats
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 2313b97bc0ccedf951ffdd85ffd3629169cfd80b upstream.

Set per_cpu_msr_sum to NULL after freeing it in the error path
of msr_sum_record() to prevent potential use-after-free issues.

Intel-SIG: commit 2313b97bc0cc tools/power turbostat: Set per_cpu_msr_sum to NULL after free
Sync turbostat to version 2025.12.02

Signed-off-by: Emily Ehlert <ehemily@amazon.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit d71cb404f002d0aa012e6b394752ff3cfc8d9f73 upstream.

Rather than starting down the conditional-compile road...

Probe the location of the MSR files at run-time.

Intel-SIG: commit d71cb404f002 tools/power turbostat: Add run-time MSR driver probe
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 19476a592bf255b9eb0308999a9ccf96b314d314 upstream.

Even though the platform->plat_rapl_msrs enumeration may be accurate,
a VM, such as AWS Nitro Hypervisor, may deny access to the underlying MSRs.

Probe if PKG_ENERGY is readable and non-zero.
If no, ignore all RAPL MSRs.

Intel-SIG: commit 19476a592bf2 tools/power turbostat: Validate RAPL MSRs for AWS Nitro Hypervisor
Sync turbostat to version 2025.12.02

Reported-by: Emily Ehlert <ehemily@amazon.de>
Tested-by: Emily Ehlert <ehemily@amazon.de>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 68769a0b5ada367d6911a8dfe50fc1e480c89fd1 upstream.

check_perf_access() will now check both IPC and LLC perf counters
if they are enabled.  If any fail, it now disables perf
and all perf counters.

Intel-SIG: commit 68769a0b5ada tools/power turbostat: Enhance perf probe
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 951845d51d1dd27ecd28a3743af3a8b22bc930ac upstream.

VMWARE correctly enumerates lack of APERF and MPERF in CPUID,
but turbostat didn't consult that before attempting to access them.

Since VMWARE allows access, but always returns 0, turbostat
got confusd into an infinite reset loop.

Head this off by listening to CPUID.6.APERF_MPERF
(and rename the existing variable to make this more clear)

Intel-SIG: commit 951845d51d1d tools/power turbostat: Validate APERF access for VMWARE
Sync turbostat to version 2025.12.02

Reported-by: David Arcari <darcari@redhat.com>
Tested-by: David Arcari <darcari@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 8808292799b0eafd32d89e12a2536debcecaac11 upstream.

Sometimes counters return junk.
For the cases where values > 100% is invalid, print "nan".

Intel-SIG: commit 8808292799b0 tools/power turbostat: Print "nan" for out of range percentages
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 2ba8b24e9da49ea25fdae82c2f093a1c688d7b99 upstream.

Added counters that are FORMAT_PERCENT
do not need to be 64-bits -- 32 is plenty.
This allows the output code to fit them,
and their header, into 8-columns.

Intel-SIG: commit 2ba8b24e9da4 tools/power turbostat: Print percentages in 8-columns
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 1a23ba6a1ba28f990d4d5fd730f663261f4de913 upstream.

Print a wide column header only for the case of a 64-bit RAW counter.

It turns out that wide column headers otherwise are more harm than good.

Intel-SIG: commit 1a23ba6a1ba2 tools/power turbostat: Print wide names only for RAW 64-bit columns
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 9c0bad7508a81110b3216231bde2a10baf7126f0 upstream.

Since release 2025.09.09:

Add LLC statistics columns:
    LLCkRPS = Last Level Cache Thousands of References Per Second
    LLC%hit = Last Level Cache Hit %
Recognize Wildcat Lake and Nova Lake platforms
Add MSR check for Android
Add APERF check for VMWARE
Add RAPL check for AWS
minor fixes

This patch:

White-space only, resulting from running Lindent
on everything except the tab-justified data-tables,
and using -l150 instead of -l80 to allow long lines.

Intel-SIG: commit 9c0bad7508a8 tools/power turbostat: version 2025.12.02
Sync turbostat to version 2025.12.02

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
…t error

commit 16cc8f249c702b7cbb4c2c2be7cd8f4fdd5d1d0c upstream.

Turbostat exits during RAPL probe with:

turbostat: cpu0: msr offset 0x611 read failed: Input/output error

A binary with this bug can be used successfully with
the option "--no-msr"

Fix this regression by trusting the static AMD RAPL MSR offset.

Intel-SIG: commit 16cc8f249c70 tools/power turbostat: AMD: msr offset 0x611 read failed: Input/output error
Sync turbostat to version 2025.12.02

Fixes: 19476a592bf2 ("tools/power turbostat: Validate RAPL MSRs for AWS Nitro Hypervisor")
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit d0f7093ad5e4aa37405da2669bca1a62d22b7025 upstream.

Divide-by-zero resulted if LLC references == 0

Pull the percentage division into pct() to centralize sanity checks there.

Intel-SIG: commit d0f7093ad5e4 tools/power turbostat: Harden against unexpected values
Sync turbostat to version 2025.12.02

Fixes: 8808292799b0 ("tools/power turbostat: Print "nan" for out of range percentages")

Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit b8ead30e2b2c7f32c8d2782e805160b110766592 upstream.

I changed my mind about displaying swidle statistics,
which are "added counters".  Recently I reverted the
column headers to 8-columns, but kept print_decimal_value()
padding out to 16-columns for all 64-bit counters.

Simplify by keeping print_decimial_value() at %lld -- which
will often fit into 8-columns, and live with the fact
that it can overflow and shift the other columns,
which continue to tab-delimited.

This is a better compromise than inserting a bunch
of space characters that most users don't like.

Intel-SIG: commit b8ead30e2b2c tools/power turbostat: Fix swidle header vs data display
Sync turbostat to version 2025.12.02

Fixes: 1a23ba6a1ba2 ("tools/power turbostat: Print wide names only for RAW 64-bit columns")
Reported-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit a444083286434ec1fd127c5da11a3091e6013008 upstream.

turbostat always used the same logic to read the microcode patch level,
which is correct for Intel but not for AMD/Hygon.
While Intel stores the patch level in the upper 32 bits of MSR, AMD
stores it in the lower 32 bits, which causes turbostat to report the
microcode version as 0x0 on AMD/Hygon.

Fix by shifting right by 32 for non-AMD/Hygon, preserving the existing
behavior for Intel and unknown vendors.

Intel-SIG: commit a44408328643 tools/power/turbostat: Fix microcode patch level output for AMD/Hygon
Sync turbostat to version 2025.12.02

Fixes: 3e40484 ("tools/power turbostat: Add --no-msr option")
Signed-off-by: Serhii Pievniev <spevnev16@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 23cb4f5c81766e70e5f32ed0987ee8fb5ab2e00a upstream.

In the perf thread, core, and package counter loops, an incorrect
'mp->format' variable is used instead of 'pp->format'.

[lenb: edit commit message]

Intel-SIG: commit 23cb4f5c8176 tools/power turbostat: Fix incorrect format variable
Sync turbostat to version 2025.12.02

Fixes: 696d15cbd8c2 ("tools/power turbostat: Refactor floating point printout code")
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit b6398bc2ef3a78f1be37ba01ae0a5eedaee47803 upstream.

Problem: individual swidle counter names (C1, C1+, C1-, etc.) cannot be
selected via --show/--hide due to two bugs in probe_cpuidle_counts():
1. The function returns immediately when BIC_cpuidle is not enabled,
   without checking deferred_add_index.
2. The deferred name check runs against name_buf before the trailing
   newline is stripped, so is_deferred_add("C1\n") never matches "C1".

Fix:
1. Relax the early return to pass through when deferred names are
   queued.
2. Strip the trailing newline from name_buf before performing deferred
   name checks.
3. Check each suffixed variant (C1+, C1, C1-) individually so that
   e.g. "--show C1+" enables only the requested metric.

In addition, introduce a helper function to avoid repeating the
condition (readability cleanup).

Intel-SIG: commit b6398bc2ef3a tools/power turbostat: Fix --show/--hide for individual cpuidle counters
Sync turbostat to version 2025.12.02

Fixes: ec4acd3166d8 ("tools/power turbostat: disable "cpuidle" invocation counters, by default")
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit cdbefe9d4029d4834d404f7ba13a960b38a69e88 upstream.

Commands that add counters, such as 'turbostat --show C1,C1+'
display merged columns without a delimiter.

This is caused by the bad syntax: '(*printed++ ? delim : "")', shared by
print_name()/print_hex_value()/print_decimal_value()/print_float_value()

Use '((*printed)++ ? delim : "")' to correctly increment the value at *printed.

[lenb: fix code and commit message typo, re-word]

Intel-SIG: commit cdbefe9d4029 tools/power turbostat: Fix delimiter bug in print functions
Sync turbostat to version 2025.12.02

Fixes: 56dbb878507b ("tools/power turbostat: Refactor added column header printing")
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit ce012c966b518c53475ba9a4e979242d7322d819 upstream.

The '-P' short option (shorthand for --no-perf) is not present in the
optstring of the second call to getopt_long_only(). This results in
the "unrecognized option" error when the tool reaches the main parsing
loop.

Add 'P' to the second getopt_long_only() call to ensure it is
consistently recognized.

Intel-SIG: commit ce012c966b51 tools/power turbostat: Fix unrecognized option '-P'
Sync turbostat to version 2025.12.02

Fixes: a0e86c9 ("tools/power turbostat: Add --no-perf option")
Signed-off-by: David Arcari <darcari@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
@zhang-rui zhang-rui changed the title [Upstream]turbostat: add DMR support sync turbostat to release 2025.12.02 Aug 9, 2026
@zhang-rui
zhang-rui force-pushed the intel-turbostat-dmr-6.6 branch from 92f3c63 to ef4d1bd Compare August 12, 2026 06:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.