Skip to content

Commit ef0e600

Browse files
committed
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 070e923 ("tools/power turbostat: Enhance HT enumeration") commit ddf60e3 ("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>
1 parent 5149609 commit ef0e600

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

tools/power/x86/turbostat/turbostat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5164,7 +5164,7 @@ static inline int get_rapl_domain_id(int cpu)
51645164
if (!platform->has_per_core_rapl)
51655165
return cpus[cpu].package_id;
51665166

5167-
return GLOBAL_CORE_ID(cpu, cpus[cpu].package_id);
5167+
return GLOBAL_CORE_ID(cpus[cpu].core_id, cpus[cpu].package_id);
51685168
}
51695169

51705170
/*
@@ -9633,7 +9633,6 @@ void topology_probe(bool startup)
96339633
}
96349634
topo.max_core_id = max_core_id; /* within a package */
96359635
topo.max_package_id = max_package_id;
9636-
topo.num_cores = (max_core_id + 1) * topo.num_packages; /* per system */
96379636

96389637
topo.cores_per_node = max_core_id + 1;
96399638
if (debug > 1)

0 commit comments

Comments
 (0)