summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/event_analyzing_sample.py
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2024-08-27 08:07:51 +0300
committerLen Brown <len.brown@intel.com>2024-12-01 00:42:06 +0300
commitfed8511cc8996989178823052dc0200643e1389a (patch)
tree6d1541e249f6fcc12b96e9f3dfeb32042793e96f /tools/perf/scripts/python/event_analyzing_sample.py
parentae2cdf8d92ffc326104524a1f9da4cf75b6ea996 (diff)
downloadlinux-fed8511cc8996989178823052dc0200643e1389a.tar.xz
tools/power turbostat: Fix trailing '\n' parsing
parse_cpu_string() parses the string input either from command line or from /sys/fs/cgroup/cpuset.cpus.effective to get a list of CPUs that turbostat can run with. The cpu string returned by /sys/fs/cgroup/cpuset.cpus.effective contains a trailing '\n', but strtoul() fails to treat this as an error. That says, for the code below val = ("\n", NULL, 10); val returns 0, and errno is also not set. As a result, CPU0 is erroneously considered as allowed CPU and this causes failures when turbostat tries to run on CPU0. get_counters: Could not migrate to CPU 0 ... turbostat: re-initialized with num_cpus 8, allowed_cpus 5 get_counters: Could not migrate to CPU 0 Add a check to return immediately if '\n' or '\0' is detected. Fixes: 8c3dd2c9e542 ("tools/power/turbostat: Abstrct function for parsing cpu string") Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions