tools/power/turbostat: Handle cgroup v2 cpu limitation
authorZhang Rui <rui.zhang@intel.com>
Fri, 20 Oct 2023 01:39:22 +0000 (09:39 +0800)
committerZhang Rui <rui.zhang@intel.com>
Tue, 24 Oct 2023 05:38:09 +0000 (13:38 +0800)
commitf638858da0925b29122f05135663013dc240eaf9
tree2a4b6e7a67054f028020c43a8a204f630203ba48
parent8c3dd2c9e54273922ea71b2a4c0e77fc624c396b
tools/power/turbostat: Handle cgroup v2 cpu limitation

CPUs can be isolated via cgroup settings and turbostat should avoid
migrating to these CPUs, just like it does for the '-c' cpus.

Introduce cpu_effective_set to save the cgroup cpu limitation info from
/sys/fs/cgroup/cpuset.cpus.effective. And use cpu_allowed_set as the
intersection of cpu_present_set, cpu_effective_set and cpu_subset.

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