[PATCH v1 12/12] perf test: Skip the LBR inline unwinding check when unsupported
From: Arnaldo Carvalho de Melo
Date: Fri Nov 13 2026 - 11:26:19 EST
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
The check only looks for the PMU's caps/branches file before recording
with --call-graph lbr. AMD BRS advertises branches but only samples its
own retired branches event, so the record with cycles is rejected and
the test fails instead of skipping.
Probe the record and skip when it fails, as the branch stack test does.
Fixes: 54a23bff770961e0 ("perf test: Test addr2line unwinding works with inline functions")
Cc: Ian Rogers <irogers@xxxxxxxxxx>
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/tests/shell/addr2line_inlines.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/perf/tests/shell/addr2line_inlines.sh b/tools/perf/tests/shell/addr2line_inlines.sh
index e8754ef2d7f21ac2..6fe47909dae4f812 100755
--- a/tools/perf/tests/shell/addr2line_inlines.sh
+++ b/tools/perf/tests/shell/addr2line_inlines.sh
@@ -71,7 +71,14 @@ test_lbr() {
fi
# Record data. Currently only dwarf callchains support inlined functions.
- perf record --call-graph lbr -e cycles:u -o "${perf_data}" -- perf test -w inlineloop 1
+ # Some PMUs advertise branches but reject branch sampling for cycles, e.g.
+ # AMD BRS, which only samples its own retired branches event.
+ if ! perf record --call-graph lbr -e cycles:u -o "${perf_data}" -- \
+ perf test -w inlineloop 1 2>/dev/null
+ then
+ echo "Skip: LBR not supported by the PMU"
+ return
+ fi
# Check output with inline (default) and srcline
perf script -i "${perf_data}" --fields +srcline > "${perf_script_txt}"
--
2.56.0