Re: [PATCH v3 12/12] perf test: Skip the LBR inline unwinding check when unsupported

From: Ian Rogers

Date: Sun Nov 15 2026 - 16:58:32 EST


On Sat, Nov 14, 2026 at 5:41 PM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> 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: 446c595dc0dd ("perf test addr2line_inlines: Ensure inline information shows on LBR leaves")
> Cc: Ian Rogers <irogers@xxxxxxxxxx>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks,
Ian

> ---
> 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
>