Commit 4ed0f392 authored by Weilin Wang's avatar Weilin Wang Committed by Arnaldo Carvalho de Melo

perf test: make metric validation test return early when there is no metric...

perf test: make metric validation test return early when there is no metric supported on the test system

Add a check to return the metric validation test early when perf list metric
does not output any metric. This would happen when NO_JEVENTS=1 is set or in a
system that there is no metric supported.
Signed-off-by: default avatarWeilin Wang <weilin.wang@intel.com>
Tested-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Caleb Biggers <caleb.biggers@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Perry Taylor <perry.taylor@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Samantha Alt <samantha.alt@intel.com>
Link: https://lore.kernel.org/lkml/20240522204254.1841420-1-weilin.wang@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 74ae366c
......@@ -95,7 +95,7 @@ class Validator:
indent=4)
def get_results(self, idx: int = 0):
return self.results[idx]
return self.results.get(idx)
def get_bounds(self, lb, ub, error, alias={}, ridx: int = 0) -> list:
"""
......@@ -173,7 +173,10 @@ class Validator:
pcnt = 0
tcnt = 0
rerun = list()
for name, val in self.get_results().items():
results = self.get_results()
if not results:
return
for name, val in results.items():
if val < 0:
negmetric[name] = val
rerun.append(name)
......@@ -532,6 +535,9 @@ class Validator:
'''
if not self.collectlist:
self.parse_perf_metrics()
if not self.metrics:
print("No metric found for testing")
return 0
self.create_rules()
for i in range(0, len(self.workloads)):
self.wlidx = i
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment