mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
Use append_inlines() in frame pointer and LBR cases. Update the addr2line test to also test frame pointers. LBR is also updated but inaccuracy in the branched to IP means the inline information is missing in the leaf. Leave LBR callchains untested for now. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Alexandre Ghiti <alex@ghiti.fr> Cc: Andi Kleen <ak@linux.intel.com> Cc: Athira Rajeev <atrajeev@linux.ibm.com> Cc: Chun-Tse Shao <ctshao@google.com> Cc: Dmitriy Vyukov <dvyukov@google.com> Cc: Dr. David Alan Gilbert <linux@treblig.org> Cc: Guo Ren <guoren@kernel.org> Cc: Haibo Xu <haibo1.xu@intel.com> Cc: Howard Chu <howardchu95@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.g.garry@oracle.com> Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com> Cc: Leo Yan <leo.yan@linux.dev> Cc: Mark Wielaard <mark@klomp.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <pjw@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sergei Trofimovich <slyich@gmail.com> Cc: Shimin Guo <shimin.guo@skydio.com> Cc: Stephen Brennan <stephen.s.brennan@oracle.com> Cc: Thomas Falcon <thomas.falcon@intel.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
69 lines
2.1 KiB
Bash
Executable File
69 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# test addr2line inline unwinding
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
set -e
|
|
|
|
err=0
|
|
test_dir=$(mktemp -d /tmp/perf-test-inline-addr2line.XXXXXXXXXX)
|
|
perf_data="${test_dir}/perf.data"
|
|
perf_script_txt="${test_dir}/perf_script.txt"
|
|
|
|
cleanup() {
|
|
rm -rf "${test_dir}"
|
|
trap - EXIT TERM INT
|
|
}
|
|
|
|
trap_cleanup() {
|
|
echo "Unexpected signal in ${FUNCNAME[1]}"
|
|
cleanup
|
|
exit 1
|
|
}
|
|
trap trap_cleanup EXIT TERM INT
|
|
|
|
test_fp() {
|
|
echo "Inline unwinding fp verification test"
|
|
# Record data. Currently only dwarf callchains support inlined functions.
|
|
perf record --call-graph fp -e task-clock: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 fp verification test [Success]"
|
|
else
|
|
echo "Inline unwinding fp verification test [Failed missing inlined functions]"
|
|
err=1
|
|
fi
|
|
}
|
|
|
|
test_dwarf() {
|
|
echo "Inline unwinding dwarf verification test"
|
|
# Record data. Currently only dwarf callchains support inlined functions.
|
|
perf record --call-graph dwarf -e task-clock: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 dwarf verification test [Success]"
|
|
else
|
|
echo "Inline unwinding dwarf verification test [Failed missing inlined functions]"
|
|
err=1
|
|
fi
|
|
}
|
|
|
|
test_fp
|
|
test_dwarf
|
|
|
|
cleanup
|
|
exit $err
|