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: Add DWARF callchain conversion test

$ perf test -vv "DWARF callchain"
87: perf inject to convert DWARF callchains to regular ones:
--- start ---
test child forked, pid 1560328
recording data with DWARF callchain
[ perf record: Woken up 4 times to write data ]
[ perf record: Captured and wrote 0.908 MB /tmp/perf-test.nM3WoW (105 samples) ]
convert DWARF callchain using perf inject
compare the both result excluding inlined functions
---- end(0) ----
87: perf inject to convert DWARF callchains to regular ones : Ok
$

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
b42c4dfe 92ea788d

+45
+45
tools/perf/tests/shell/inject-callchain.sh
··· 1 + #!/bin/bash 2 + # perf inject to convert DWARF callchains to regular ones 3 + # SPDX-License-Identifier: GPL-2.0 4 + 5 + if ! perf check feature -q dwarf; then 6 + echo "SKIP: DWARF support is not available" 7 + exit 2 8 + fi 9 + 10 + TESTDATA=$(mktemp /tmp/perf-test.XXXXXX) 11 + 12 + err=0 13 + 14 + cleanup() 15 + { 16 + trap - EXIT TERM INT 17 + rm -f ${TESTDATA}* 18 + } 19 + 20 + trap_cleanup() 21 + { 22 + cleanup 23 + exit 1 24 + } 25 + 26 + trap trap_cleanup EXIT TERM INT 27 + 28 + echo "recording data with DWARF callchain" 29 + perf record -F 999 --call-graph dwarf -o "${TESTDATA}" -- perf test -w noploop 30 + 31 + echo "convert DWARF callchain using perf inject" 32 + perf inject -i "${TESTDATA}" --convert-callchain -o "${TESTDATA}.new" 33 + 34 + perf report -i "${TESTDATA}" --no-children -q --percent-limit=1 > ${TESTDATA}.out 35 + perf report -i "${TESTDATA}.new" --no-children -q --percent-limit=1 > ${TESTDATA}.new.out 36 + 37 + echo "compare the both result excluding inlined functions" 38 + if diff -u "${TESTDATA}.out" "${TESTDATA}.new.out" | grep "^- " | grep -qv "(inlined)"; then 39 + echo "Found some differences" 40 + diff -u "${TESTDATA}.out" "${TESTDATA}.new.out" 41 + err=1 42 + fi 43 + 44 + cleanup 45 + exit $err