linux-stable/tools/perf/tests/shell/lib
Namhyung Kim 8d3df7c39b perf test: Reorder event name checks in stat STD output linter
On AMD machines, the perf stat STD output test failed like below:

  $ sudo ./perf test -v 98
   98: perf stat STD output linter                                     :
  --- start ---
  test child forked, pid 1841901
  Checking STD output: no argswrong event metric.
    expected 'GHz' in 108,121 stalled-cycles-frontend  # 10.88% frontend cycles idle
  test child finished with -1
  ---- end ----
  perf stat STD output linter: FAILED!

This is because there are stalled-cycles-{frontend,backend} events are
used by default.  The current logic checks the event_name array to find
which event it's running.  But 'cycles' event comes before those stalled
cycles event and it matches first.  So it tries to find 'GHz' metric
in the output (which is for the 'cycles') and fails.

Move the stalled-cycles-{frontend,backend} events before 'cycles' so
that it can find the stalled cycles events first.

Also add a space after 'no args' test name for consistency.

Fixes: 99a04a48f2 ("perf test: Add test case for the standard 'perf stat' output")
Acked-by: Ian Rogers <irogers@google.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230623230139.985594-1-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2023-06-23 21:35:45 -07:00
..
coresight.sh perf test: Replace legacy ... with $(...) 2023-02-02 16:32:19 -03:00
perf_json_output_lint.py pert tests: Update metric-value for perf stat JSON output 2023-06-15 22:16:59 -03:00
perf_metric_validation.py perf test: Rerun failed metrics with longer workload 2023-06-21 22:24:26 -07:00
perf_metric_validation_rules.json perf test: Add skip list for metrics known would fail 2023-06-21 22:23:57 -07:00
probe.sh perf tests: Add missing SPDX headers 2019-06-17 15:57:19 -03:00
probe_vfs_getname.sh perf tests shell: Fix check for libtracevent support 2023-02-01 21:44:26 -03:00
stat_output.sh perf test: Reorder event name checks in stat STD output linter 2023-06-23 21:35:45 -07:00
waiting.sh perf test: waiting.sh: Parameterize timeouts 2022-10-04 08:55:23 -03:00