summaryrefslogtreecommitdiff
path: root/tools/perf/tests/shell
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-09-28 11:26:02 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-10-01 17:49:27 +0200
commite4ed3ba7e2d5a548220511b8e64d2902318348e7 (patch)
treef1fde79f2ebf063f72364fc7289e29209ca226b9 /tools/perf/tests/shell
parent5df51199975e605ec4f0cca86fbd1c6ebf59c58c (diff)
perf test trace_summary: Improve error diagnostics
On a mismatch print the command, the match count, the matching lines and the end of the output. Reviewed-by: Namhyung Kim <namhyung@kernel.org> Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers <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/trace_summary.sh13
1 files 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
}