summaryrefslogtreecommitdiff
path: root/tools/perf/tests/shell
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2022-01-31 17:58:33 -0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-02-14 21:04:20 -0300
commit00236a2dc8a3768fdc689380d2e93b96cc971bd7 (patch)
tree23cbc3c15a209da66a8841ac2ed93f65c1eeb983 /tools/perf/tests/shell
parent59835f55ce026df6eb8d022f5bc2a14f5151555d (diff)
perf test: Allow skip for all metrics test
Some Intel TMA metrics compute a ratio that may divide by 0, which causes the metric not to print. This happens for metrics with FP_ARITH events. If we see these events in the result and would otherwise fail, then switch to a skip. Also, don't early exit when processing metrics. Reviewed-by: John Garry <john.garry@huawei.com> Reviewed-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com> Link: https://lore.kernel.org/r/20220201015858.1226914-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/shell')
-rwxr-xr-xtools/perf/tests/shell/stat_all_metrics.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/tests/shell/stat_all_metrics.sh b/tools/perf/tests/shell/stat_all_metrics.sh
index 7f4ba3cad632..e7c59e5a7a98 100755
--- a/tools/perf/tests/shell/stat_all_metrics.sh
+++ b/tools/perf/tests/shell/stat_all_metrics.sh
@@ -4,6 +4,7 @@
set -e
+err=0
for m in $(perf list --raw-dump metrics); do
echo "Testing $m"
result=$(perf stat -M "$m" true 2>&1)
@@ -14,9 +15,14 @@ for m in $(perf list --raw-dump metrics); do
if [[ ! "$result" =~ "$m" ]]; then
echo "Metric '$m' not printed in:"
echo "$result"
- exit 1
+ if [[ "$result" =~ "FP_ARITH" && "$err" != "1" ]]; then
+ echo "Skip, not fail, for FP issues"
+ err=2
+ else
+ err=1
+ fi
fi
fi
done
-exit 0
+exit "$err"