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>
return perf.parse_metrics(self.metric_name, self.metric_pmu)
def value(self, evlist: perf.evlist, evsel: perf.evsel, cpu: int, thread: int) -> float:
- val = evlist.compute_metric(self.metric_name, cpu, thread)
- return 0 if math.isnan(val) else val
+ try:
+ val = evlist.compute_metric(self.metric_name, cpu, thread)
+ return 0 if math.isnan(val) else val
+ except:
+ # Be tolerant of failures to compute metrics on particular CPUs/threads.
+ return 0
@dataclass