brintos

brintos / linux-shallow public Read only

0
0
Text · 1.2 KiB · 9caa361 Raw
49 lines · bash
1#!/bin/sh2# Check Arm64 callgraphs are complete in fp mode3# SPDX-License-Identifier: GPL-2.04 5shelldir=$(dirname "$0")6# shellcheck source=lib/perf_has_symbol.sh7. "${shelldir}"/lib/perf_has_symbol.sh8 9if [ "$(uname -m)" != "aarch64" ]; then10	exit 211fi12 13if perf version --build-options | grep HAVE_DWARF_UNWIND_SUPPORT | grep -q OFF14then15  echo "Skipping, no dwarf unwind support"16  exit 217fi18 19skip_test_missing_symbol leafloop20 21PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX)22TEST_PROGRAM="perf test -w leafloop"23 24cleanup_files()25{26	rm -f "$PERF_DATA"27}28 29trap cleanup_files EXIT TERM INT30 31# shellcheck disable=SC208632perf record -o "$PERF_DATA" --call-graph fp -e cycles//u --user-callchains -- $TEST_PROGRAM33 34# Try opening the file so any immediate errors are visible in the log35perf script -i "$PERF_DATA" -F comm,ip,sym | head -n436 37# expected perf-script output if 'leaf' has been inserted correctly:38#39# perf40# 	728 leaf41# 	753 parent42# 	76c leafloop43# ... remaining stack to main() ...44 45# Each frame is separated by a tab, some spaces and an address46SEP="[[:space:]]+ [[:xdigit:]]+"47perf script -i "$PERF_DATA" -F comm,ip,sym | tr '\n' ' ' | \48	grep -E -q "perf $SEP leaf $SEP parent $SEP leafloop"49