Skip to content

Commit 4ede6d1

Browse files
committed
tools/power/turbostat: Obey allowed CPUs when accessing CPU counters
for_all_cpus/for_all_cpus_2 are used for accessing the per CPU counters, and they should follow the cpu_allowed_set instead of cpu_present_set. Signed-off-by: Zhang Rui <[email protected]>
1 parent 71cfd1d commit 4ede6d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/power/x86/turbostat/turbostat.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ int for_all_cpus(int (func) (struct thread_data *, struct core_data *, struct pk
11821182

11831183
t = GET_THREAD(thread_base, thread_no, core_no, node_no, pkg_no);
11841184

1185-
if (cpu_is_not_present(t->cpu_id))
1185+
if (cpu_is_not_allowed(t->cpu_id))
11861186
continue;
11871187

11881188
c = GET_CORE(core_base, core_no, node_no, pkg_no);
@@ -3618,7 +3618,7 @@ int for_all_cpus_2(int (func) (struct thread_data *, struct core_data *,
36183618

36193619
t = GET_THREAD(thread_base, thread_no, core_no, node_no, pkg_no);
36203620

3621-
if (cpu_is_not_present(t->cpu_id))
3621+
if (cpu_is_not_allowed(t->cpu_id))
36223622
continue;
36233623

36243624
t2 = GET_THREAD(thread_base2, thread_no, core_no, node_no, pkg_no);

0 commit comments

Comments
 (0)