Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Weilin Wang <weilin.wang@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
446c595d 04f81f45

+28
+28
tools/perf/tests/shell/addr2line_inlines.sh
··· 61 61 fi 62 62 } 63 63 64 + test_lbr() { 65 + echo "Inline unwinding LBR verification test" 66 + if [ ! -f /sys/bus/event_source/devices/cpu/caps/branches ] && 67 + [ ! -f /sys/bus/event_source/devices/cpu_core/caps/branches ] 68 + then 69 + echo "Skip: only x86 CPUs support LBR" 70 + return 71 + fi 72 + 73 + # Record data. Currently only dwarf callchains support inlined functions. 74 + perf record --call-graph lbr -e cycles:u -o "${perf_data}" -- perf test -w inlineloop 1 75 + 76 + # Check output with inline (default) and srcline 77 + perf script -i "${perf_data}" --fields +srcline > "${perf_script_txt}" 78 + 79 + # Expect the leaf and middle functions to occur on lines in the 20s, with 80 + # the non-inlined parent function on a line in the 30s. 81 + if grep -q "inlineloop.c:2. (inlined)" "${perf_script_txt}" && 82 + grep -q "inlineloop.c:3.$" "${perf_script_txt}" 83 + then 84 + echo "Inline unwinding lbr verification test [Success]" 85 + else 86 + echo "Inline unwinding lbr verification test [Failed missing inlined functions]" 87 + err=1 88 + fi 89 + } 90 + 64 91 test_fp 65 92 test_dwarf 93 + test_lbr 66 94 67 95 cleanup 68 96 exit $err