Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf ilist: Be tolerant of reading a metric on the wrong CPU

This happens on hybrid machine metrics. Be tolerant and don't cause
the ilist application to crash with an exception.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Falcon <thomas.falcon@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
4b11c983 6603c3c1

+6 -2
+6 -2
tools/perf/python/ilist.py
··· 77 77 return perf.parse_metrics(self.metric_name, self.metric_pmu) 78 78 79 79 def value(self, evlist: perf.evlist, evsel: perf.evsel, cpu: int, thread: int) -> float: 80 - val = evlist.compute_metric(self.metric_name, cpu, thread) 81 - return 0 if math.isnan(val) else val 80 + try: 81 + val = evlist.compute_metric(self.metric_name, cpu, thread) 82 + return 0 if math.isnan(val) else val 83 + except: 84 + # Be tolerant of failures to compute metrics on particular CPUs/threads. 85 + return 0 82 86 83 87 84 88 @dataclass