tools/power/turbostat: Abstract several functions
authorZhang Rui <rui.zhang@intel.com>
Wed, 4 Oct 2023 07:13:23 +0000 (15:13 +0800)
committerZhang Rui <rui.zhang@intel.com>
Fri, 20 Oct 2023 02:27:09 +0000 (10:27 +0800)
commit74318add132365db3026e281ac06836a26cda857
tree6d6b6c27f279a9b1d15d846091ab2ae7162a9564
parent7bb3fe27ad4f62039b2ac80a2147452a608b474f
tools/power/turbostat: Abstract several functions

When detecting the primary thread/core in a core/package, current code
doesn't handle the allowed CPUs.

Abstract several functions for further fix of this issue.

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
tools/power/x86/turbostat/turbostat.c