[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260205205622.530825-2-irogers@google.com>
Date: Thu, 5 Feb 2026 12:56:22 -0800
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@...aro.org>, Andi Kleen <ak@...ux.intel.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
"Krzysztof Ćopatowski" <krzysztof.m.lopatowski@...il.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, Dapeng Mi <dapeng1.mi@...ux.intel.com>,
Weilin Wang <weilin.wang@...el.com>
Subject: [PATCH v1 2/2] perf test addr2line_inlines: Ensure inline information
shows on LBR leaves
Expand the addr2line inline function testing to also run for an LBR
callchain, skipping if LBR support isn't present.
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
tools/perf/tests/shell/addr2line_inlines.sh | 28 +++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/tools/perf/tests/shell/addr2line_inlines.sh b/tools/perf/tests/shell/addr2line_inlines.sh
index ce30d9c7e0bf..e8754ef2d7f2 100755
--- a/tools/perf/tests/shell/addr2line_inlines.sh
+++ b/tools/perf/tests/shell/addr2line_inlines.sh
@@ -61,8 +61,36 @@ test_dwarf() {
fi
}
+test_lbr() {
+ echo "Inline unwinding LBR verification test"
+ if [ ! -f /sys/bus/event_source/devices/cpu/caps/branches ] &&
+ [ ! -f /sys/bus/event_source/devices/cpu_core/caps/branches ]
+ then
+ echo "Skip: only x86 CPUs support LBR"
+ return
+ 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
+
+ # Check output with inline (default) and srcline
+ perf script -i "${perf_data}" --fields +srcline > "${perf_script_txt}"
+
+ # Expect the leaf and middle functions to occur on lines in the 20s, with
+ # the non-inlined parent function on a line in the 30s.
+ if grep -q "inlineloop.c:2. (inlined)" "${perf_script_txt}" &&
+ grep -q "inlineloop.c:3.$" "${perf_script_txt}"
+ then
+ echo "Inline unwinding lbr verification test [Success]"
+ else
+ echo "Inline unwinding lbr verification test [Failed missing inlined functions]"
+ err=1
+ fi
+}
+
test_fp
test_dwarf
+test_lbr
cleanup
exit $err
--
2.53.0.rc2.204.g2597b5adb4-goog
Powered by blists - more mailing lists