[PATCH v2 6/7] perf test trace_summary: Skip --bpf-summary tests if no libbpf
From: Ian Rogers
Date: Tue May 27 2025 - 23:28:12 EST
If perf is built without libbpf (e.g. NO_LIBBPF=1) then the
--bpf-summary perf trace tests will fail. Skip the tests as this is
expected behavior.
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/tests/shell/trace_summary.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/perf/tests/shell/trace_summary.sh b/tools/perf/tests/shell/trace_summary.sh
index 49766524dc21..f9bb7f9388be 100755
--- a/tools/perf/tests/shell/trace_summary.sh
+++ b/tools/perf/tests/shell/trace_summary.sh
@@ -53,6 +53,12 @@ test_perf_trace "-as --summary-mode=thread --no-bpf-summary"
# summary only for system wide - total summary mode
test_perf_trace "-as --summary-mode=total --no-bpf-summary"
+if ! perf check feature -q bpf; then
+ echo "Skip --bpf-summary tests as perf built without libbpf"
+ rm -f ${OUTPUT}
+ exit 2
+fi
+
# summary only for system wide - per-thread summary with BPF
test_perf_trace "-as --summary-mode=thread --bpf-summary"
--
2.49.0.1238.gf8c92423fb-goog