tools/power/turbostat: Abstrct function for parsing cpu string
authorZhang Rui <rui.zhang@intel.com>
Fri, 20 Oct 2023 01:45:21 +0000 (09:45 +0800)
committerZhang Rui <rui.zhang@intel.com>
Tue, 24 Oct 2023 05:37:46 +0000 (13:37 +0800)
commit8c3dd2c9e54273922ea71b2a4c0e77fc624c396b
treea37c467365d4d86d102f14923849b495a34d9b88
parentc25ef0e5d9d7d5fb9e1679286fc7a11e70f16c70
tools/power/turbostat: Abstrct function for parsing cpu string

Abstract parse_cpu_str() which can update any specified cpu_set by a
given cpu string. This can be used to handle further CPU limitations
from other sources like cgroup.

The cpu string parsing code is also enhanced to handle the strings that
have an extra '\n' before string terminator.

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