diff options
| author | Len Brown <len.brown@intel.com> | 2026-02-17 20:31:51 -0600 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2026-02-17 23:27:52 -0600 |
| commit | ef0e60083f768b32cda17b1b0ca9519405db89a6 (patch) | |
| tree | 6682baa76f58ed32a91586dadc2873dd6312ac6a | |
| parent | 51496091dd37b405e6e399a9638da3f1da3f4c64 (diff) | |
tools/power turbostat: Fix AMD RAPL regression
turbostat.c:8688: rapl_perf_init: Assertion `next_domain < num_domains' failed.
Two recent cleanup patches that were not supposed to change anything
broke the core_id code needed for AMD RAPL initialization:
commit 070e92361eec ("tools/power turbostat: Enhance HT enumeration")
commit ddf60e38ca04 ("tools/power turbostat: Simplify global core_id calculation")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
| -rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 1aace9b3269e..1a2671c28209 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -5164,7 +5164,7 @@ static inline int get_rapl_domain_id(int cpu) if (!platform->has_per_core_rapl) return cpus[cpu].package_id; - return GLOBAL_CORE_ID(cpu, cpus[cpu].package_id); + return GLOBAL_CORE_ID(cpus[cpu].core_id, cpus[cpu].package_id); } /* @@ -9633,7 +9633,6 @@ void topology_probe(bool startup) } topo.max_core_id = max_core_id; /* within a package */ topo.max_package_id = max_package_id; - topo.num_cores = (max_core_id + 1) * topo.num_packages; /* per system */ topo.cores_per_node = max_core_id + 1; if (debug > 1) |
