[PATCH 7/8] pert tests: Support metricgroup perf stat JSON output

kan.liang@linux.intel.com posted 8 patches 2 years, 8 months ago
There is a newer version of this series
[PATCH 7/8] pert tests: Support metricgroup perf stat JSON output
Posted by kan.liang@linux.intel.com 2 years, 8 months ago
From: Kan Liang <kan.liang@linux.intel.com>

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>
---
 tools/perf/tests/shell/lib/perf_json_output_lint.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/tests/shell/lib/perf_json_output_lint.py b/tools/perf/tests/shell/lib/perf_json_output_lint.py
index b81582a89d36..5e9bd68c83fe 100644
--- a/tools/perf/tests/shell/lib/perf_json_output_lint.py
+++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py
@@ -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}\'')
-- 
2.35.1
Re: [PATCH 7/8] pert tests: Support metricgroup perf stat JSON output
Posted by Ian Rogers 2 years, 7 months ago
On Wed, Jun 7, 2023 at 9:27 AM <kan.liang@linux.intel.com> wrote:
>
> From: Kan Liang <kan.liang@linux.intel.com>
>
> 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>

Thanks,
Ian

> ---
>  tools/perf/tests/shell/lib/perf_json_output_lint.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/tests/shell/lib/perf_json_output_lint.py b/tools/perf/tests/shell/lib/perf_json_output_lint.py
> index b81582a89d36..5e9bd68c83fe 100644
> --- a/tools/perf/tests/shell/lib/perf_json_output_lint.py
> +++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py
> @@ -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}\'')
> --
> 2.35.1
>
Re: [PATCH 7/8] pert tests: Support metricgroup perf stat JSON output
Posted by Arnaldo Carvalho de Melo 2 years, 7 months ago
Em Tue, Jun 13, 2023 at 01:17:41PM -0700, Ian Rogers escreveu:
> On Wed, Jun 7, 2023 at 9:27 AM <kan.liang@linux.intel.com> wrote:
> >
> > From: Kan Liang <kan.liang@linux.intel.com>
> >
> > 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>

Thanks, applied.

- Arnaldo