perf test stat_all_metrics: Ensure missing events fail test
authorIan Rogers <irogers@google.com>
Tue, 11 Feb 2025 21:30:31 +0000 (13:30 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 13 Feb 2025 03:54:40 +0000 (19:54 -0800)
Issue reported by Thomas Falcon and diagnosed by Kan Liang here:
https://lore.kernel.org/lkml/d44036481022c27d83ce0faf8c7f77042baedb34.camel@intel.com/
Metrics with missing events can be erroneously skipped if they contain
FP, AMX or PMM events.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Kan Liang <kan.liang@linux.intel.com>
Tested-by: Thomas Falcon <thomas.falcon@intel.com>
Link: https://lore.kernel.org/r/20250211213031.114209-25-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/tests/shell/stat_all_metrics.sh

index 73e9347e88a964bd479102f559ee092e4ea1c509..ee817c66da061829796b5487f5e16ed87bdd2584 100755 (executable)
@@ -20,7 +20,13 @@ for m in $(perf list --raw-dump metrics); do
   result_err=$?
   if [[ $result_err -gt 0 ]]
   then
-    if [[ "$result" =~ \
+    if [[ "$result" =~ "Cannot resolve IDs for" ]]
+    then
+      echo "Metric contains missing events"
+      echo $result
+      err=1 # Fail
+      continue
+    elif [[ "$result" =~ \
           "Access to performance monitoring and observability operations is limited" ]]
     then
       echo "Permission failure"