3 # SPDX-License-Identifier: GPL-2.0
8 perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
20 trap trap_cleanup exit term int
23 echo "Basic --per-thread mode test"
24 if ! perf record -e instructions:u -o ${perfdata} --quiet true 2> /dev/null
26 echo "Per-thread record [Skipped instructions:u not supported]"
33 if ! perf record -e instructions:u --per-thread -o ${perfdata} true 2> /dev/null
35 echo "Per-thread record of instructions:u [Failed]"
39 if ! perf report -i ${perfdata} -q | egrep -q true
41 echo "Per-thread record [Failed missing output]"
45 echo "Basic --per-thread mode test [Success]"
48 test_register_capture() {
49 echo "Register capture test"
50 if ! perf list | egrep -q 'br_inst_retired.near_call'
52 echo "Register capture test [Skipped missing instruction]"
59 if ! perf record --intr-regs=\? 2>&1 | egrep -q 'available registers: AX BX CX DX SI DI BP SP IP FLAGS CS SS R8 R9 R10 R11 R12 R13 R14 R15'
61 echo "Register capture test [Skipped missing registers]"
64 if ! perf record -o - --intr-regs=di,r8,dx,cx -e cpu/br_inst_retired.near_call/p \
65 -c 1000 --per-thread true 2> /dev/null \
66 | perf script -F ip,sym,iregs -i - 2> /dev/null \
69 echo "Register capture test [Failed missing output]"
73 echo "Register capture test [Success]"