Skip to content

Commit

Permalink
tools/power/turbostat: Obey allowed CPUs when accessing CPU counters
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
zhang-rui committed Oct 20, 2023
1 parent 71cfd1d commit 4ede6d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ int for_all_cpus(int (func) (struct thread_data *, struct core_data *, struct pk

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

if (cpu_is_not_present(t->cpu_id))
if (cpu_is_not_allowed(t->cpu_id))
continue;

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

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

if (cpu_is_not_present(t->cpu_id))
if (cpu_is_not_allowed(t->cpu_id))
continue;

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

0 comments on commit 4ede6d1

Please sign in to comment.