pert tests: Support metricgroup perf stat JSON output
authorKan Liang <kan.liang@linux.intel.com>
Wed, 7 Jun 2023 16:26:59 +0000 (09:26 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 14 Jun 2023 02:40:34 +0000 (23:40 -0300)
A new field metricgroup has been added in the perf stat JSON output.
Support it in the test case.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ahmad Yasin <ahmad.yasin@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20230607162700.3234712-8-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/shell/lib/perf_json_output_lint.py

index b81582a..5e9bd68 100644 (file)
@@ -55,6 +55,7 @@ def check_json_output(expected_items):
       'interval': lambda x: isfloat(x),
       'metric-unit': lambda x: True,
       'metric-value': lambda x: isfloat(x),
+      'metricgroup': lambda x: True,
       'node': lambda x: True,
       'pcnt-running': lambda x: isfloat(x),
       'socket': lambda x: True,
@@ -70,6 +71,8 @@ def check_json_output(expected_items):
         # values and possibly other prefixes like interval, core and
         # aggregate-number.
         pass
+      elif count != expected_items and count >= 1 and count <= 5 and 'metricgroup' in item:
+        pass
       elif count != expected_items:
         raise RuntimeError(f'wrong number of fields. counted {count} expected {expected_items}'
                            f' in \'{item}\'')