tools/power turbostat: Use sched_getcpu() instead of hardcoded cpu 0
authorPrarit Bhargava <prarit@redhat.com>
Mon, 29 Jun 2020 19:26:57 +0000 (15:26 -0400)
committerLen Brown <len.brown@intel.com>
Thu, 3 Sep 2020 17:57:47 +0000 (13:57 -0400)
commit8201a0285789fade1c5b031914577e2b27a64f05
treeeb4994c870de72b430d38961b4aac0bb0e6bee17
parent9972d5d84d76982606806b2ce887f70c2f8ba60a
tools/power turbostat: Use sched_getcpu() instead of hardcoded cpu 0

Disabling cpu 0 results in an error

turbostat: /sys/devices/system/cpu/cpu0/topology/thread_siblings: open failed: No such file or directory

Use sched_getcpu() instead of a hardcoded cpu 0 to get the max cpu number.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c