[PATCH v6 23/26] perf test trace_summary: Improve error diagnostics
From: Ian Rogers
Date: Mon Sep 28 2026 - 14:31:57 EST
On a mismatch print the command, the match count, the matching lines and
the end of the output.
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/tests/shell/trace_summary.sh | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tools/perf/tests/shell/trace_summary.sh b/tools/perf/tests/shell/trace_summary.sh
index d5da1d7d8d88..273199a29a20 100755
--- a/tools/perf/tests/shell/trace_summary.sh
+++ b/tools/perf/tests/shell/trace_summary.sh
@@ -27,10 +27,15 @@ test_perf_trace() {
count=$(grep -E -c -m 3 "${search}" ${OUTPUT})
if [ "${count}" != "3" ]; then
- echo "Error: cannot find enough pattern ${search} in the output"
- cat ${OUTPUT}
- rm -f ${OUTPUT}
- exit 1
+ echo "Error: cannot find enough pattern ${search} (count=${count}) in output of:"
+ echo "Error: perf trace ${args} -- ${workload}"
+ echo "Error: matched lines:"
+ grep -E "${search}" ${OUTPUT} || echo "none"
+ echo "Error: last 20 lines of output:"
+ # The summary comes last, after any -S trace output.
+ tail -n 20 ${OUTPUT}
+ rm -f ${OUTPUT}
+ exit 1
fi
}
--
2.56.0.rc1.315.gc6ed9934b7-goog