Lines Matching +full:test +full:- +full:cpu
3 # SPDX-License-Identifier: GPL-2.0
5 set -e
20 testprog="perf test -w thloop"
21 cpu_pmu_dir="/sys/bus/event_source/devices/cpu*"
26 rm -rf "${perfdata}"
27 rm -rf "${perfdata}".old
29 trap - EXIT TERM INT
39 echo "Basic --per-thread mode test"
40 if ! perf record -o /dev/null --quiet ${testprog} 2> /dev/null
42 echo "Per-thread record [Skipped event not supported]"
45 if ! perf record --per-thread -o "${perfdata}" ${testprog} 2> /dev/null
47 echo "Per-thread record [Failed record]"
51 if ! perf report -i "${perfdata}" -q | grep -q "${testsym}"
53 echo "Per-thread record [Failed missing output]"
58 # run the test program in background (for 30 seconds)
62 rm -f "${perfdata}"
65 perf record -p "${TESTPID}" --per-thread -o "${perfdata}" sleep 1 2> /dev/null
68 if [ ! -e "${perfdata}" ]
70 echo "Per-thread record [Failed record -p]"
74 if ! perf report -i "${perfdata}" -q | grep -q "${testsym}"
76 echo "Per-thread record [Failed -p missing output]"
81 echo "Basic --per-thread mode test [Success]"
85 echo "Register capture test"
86 if ! perf list | grep -q 'br_inst_retired.near_call'
88 echo "Register capture test [Skipped missing event]"
91 …if ! perf record --intr-regs=\? 2>&1 | grep -q 'available registers: AX BX CX DX SI DI BP SP IP FL…
93 echo "Register capture test [Skipped missing registers]"
96 if ! perf record -o - --intr-regs=di,r8,dx,cx -e br_inst_retired.near_call \
97 -c 1000 --per-thread ${testprog} 2> /dev/null \
98 | perf script -F ip,sym,iregs -i - 2> /dev/null \
99 | grep -q "DI:"
101 echo "Register capture test [Failed missing output]"
105 echo "Register capture test [Success]"
109 echo "Basic --system-wide mode test"
110 if ! perf record -aB --synth=no -o "${perfdata}" ${testprog} 2> /dev/null
112 echo "System-wide record [Skipped not supported]"
115 if ! perf report -i "${perfdata}" -q | grep -q "${testsym}"
117 echo "System-wide record [Failed missing output]"
121 if ! perf record -aB --synth=no -e cpu-clock,cs --threads=cpu \
122 -o "${perfdata}" ${testprog} 2> /dev/null
124 echo "System-wide record [Failed record --threads option]"
128 if ! perf report -i "${perfdata}" -q | grep -q "${testsym}"
130 echo "System-wide record [Failed --threads missing output]"
134 echo "Basic --system-wide mode test [Success]"
138 echo "Basic target workload test"
139 if ! perf record -o "${perfdata}" ${testprog} 2> /dev/null
145 if ! perf report -i "${perfdata}" -q | grep -q "${testsym}"
151 if ! perf record -e cpu-clock,cs --threads=package \
152 -o "${perfdata}" ${testprog} 2> /dev/null
154 echo "Workload record [Failed record --threads option]"
158 if ! perf report -i "${perfdata}" -q | grep -q "${testsym}"
160 echo "Workload record [Failed --threads missing output]"
164 echo "Basic target workload test [Success]"
168 echo "Basic branch counter test"
172 if [ ! -e "$dir$br_cntr_file" ]
178 if ! perf record -o "${perfdata}" -j any,counter ${testprog} 2> /dev/null
180 echo "Basic branch counter test [Failed record]"
184 if ! perf report -i "${perfdata}" -D -q | grep -q "$br_cntr_output"
186 echo "Basic branch record test [Failed missing output]"
190 echo "Basic branch counter test [Success]"