diff options
author | Zhang Rui <rui.zhang@intel.com> | 2023-10-04 08:52:02 +0300 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2023-10-20 05:27:09 +0300 |
commit | 4ede6d1ce7acba9cafe7df4e935b174623cd2181 (patch) | |
tree | be7eb1da03205de8ea4a262e00401bd61ed24564 /tools/power/x86/turbostat | |
parent | 71cfd1da9f0635ccd7124ad8b67b9aed596be491 (diff) | |
download | linux-4ede6d1ce7acba9cafe7df4e935b174623cd2181.tar.xz |
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 <rui.zhang@intel.com>
Diffstat (limited to 'tools/power/x86/turbostat')
-rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index d8f44ea5b4bf..202cf5231d7a 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -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); @@ -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); |