2 # Check Arm64 callgraphs are complete in fp mode
3 # SPDX-License-Identifier: GPL-2.0
5 shelldir=$(dirname "$0")
6 # shellcheck source=lib/perf_has_symbol.sh
7 . "${shelldir}"/lib/perf_has_symbol.sh
9 lscpu | grep -q "aarch64" || exit 2
11 skip_test_missing_symbol leafloop
13 PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
14 TEST_PROGRAM="perf test -w leafloop"
21 trap cleanup_files EXIT TERM INT
23 # Add a 1 second delay to skip samples that are not in the leaf() function
24 # shellcheck disable=SC2086
25 perf record -o "$PERF_DATA" --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null &
28 echo " + Recording (PID=$PID)..."
30 echo " + Stopping perf-record..."
35 # expected perf-script output:
43 perf script -i "$PERF_DATA" -F comm,ip,sym | head -n4
44 perf script -i "$PERF_DATA" -F comm,ip,sym | head -n4 | \
45 awk '{ if ($2 != "") sym[i++] = $2 } END { if (sym[0] != "leaf" ||
47 sym[2] != "leafloop") exit 1 }'