Lines Matching +full:test +full:- +full:cpu

3 # SPDX-License-Identifier: GPL-2.0
5 set -e
9 echo "Basic stat command test"
10 if ! perf stat true 2>&1 | grep -E -q "Performance counter stats for 'true':"
12 echo "Basic stat command test [Failed]"
16 echo "Basic stat command test [Success]"
20 echo "stat record and report test"
21 if ! perf stat record -o - true | perf stat report -i - 2>&1 | \
22 grep -E -q "Performance counter stats for 'pipe':"
24 echo "stat record and report test [Failed]"
28 echo "stat record and report test [Success]"
32 echo "stat record and script test"
33 if ! perf stat record -o - true | perf script -i - 2>&1 | \
34 …grep -E -q "CPU[[:space:]]+THREAD[[:space:]]+VAL[[:space:]]+ENA[[:space:]]+RUN[[:space:]]+TIME[[:s…
36 echo "stat record and script test [Failed]"
40 echo "stat record and script test [Success]"
44 echo "stat repeat weak groups test"
45 if ! perf stat -e '{cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles}' \
46 true 2>&1 | grep -q 'seconds time elapsed'
48 echo "stat repeat weak groups test [Skipped event parsing failed]"
51 …if ! perf stat -r2 -e '{cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles}:W' \
54 echo "stat repeat weak groups test [Failed]"
58 echo "stat repeat weak groups test [Success]"
62 # Topdown events must be grouped with the slots event first. Test that
63 # parse-events reorders this.
64 echo "Topdown event group test"
65 if ! perf stat -e '{slots,topdown-retiring}' true > /dev/null 2>&1
67 echo "Topdown event group test [Skipped event parsing failed]"
70 if perf stat -e '{slots,topdown-retiring}' true 2>&1 | grep -E -q "<not supported>"
72 echo "Topdown event group test [Failed events not supported]"
76 if perf stat -e 'instructions,topdown-retiring,slots' true 2>&1 | grep -E -q "<not supported>"
78 echo "Topdown event group test [Failed slots not reordered first in no-group case]"
82 if perf stat -e '{instructions,topdown-retiring,slots}' true 2>&1 | grep -E -q "<not supported>"
84 echo "Topdown event group test [Failed slots not reordered first in single group case]"
88 if perf stat -e '{instructions,slots},topdown-retiring' true 2>&1 | grep -E -q "<not supported>"
90 echo "Topdown event group test [Failed topdown metrics event not move into slots group]"
94 if perf stat -e '{instructions,slots},{topdown-retiring}' true 2>&1 | grep -E -q "<not supported>"
96 echo "Topdown event group test [Failed topdown metrics group not merge into slots group]"
100 if perf stat -e '{instructions,r400,r8000}' true 2>&1 | grep -E -q "<not supported>"
102 echo "Topdown event group test [Failed raw format slots not reordered first]"
106 echo "Topdown event group test [Success]"
111 # fails. Breaking a topdown group causes the events to fail. Test a very large
113 echo "Topdown weak groups test"
114-bad-spec,topdown-be-bound,topdown-fe-bound,topdown-retiring},branch-instructions,branch-misses,bu…
115 if ! perf stat --no-merge -e "$ok_grouping" true > /dev/null 2>&1
117 echo "Topdown weak groups test [Skipped event parsing failed]"
120-bad-spec,topdown-be-bound,topdown-fe-bound,topdown-retiring,branch-instructions,branch-misses,bus
121 if perf stat --no-merge -e "$group_needs_break" true 2>&1 | grep -E -q "<not supported>"
123 echo "Topdown weak groups test [Failed events not supported]"
127 echo "Topdown weak groups test [Success]"
131 # Test --cputype argument.
132 echo "cputype test"
135 if perf stat --cputype="123" -e instructions true > /dev/null 2>&1
137 echo "cputype test [Bogus PMU didn't fail]"
145 for i in $devs/cpu $devs/cpu_atom $devs/armv8_pmuv3_0 $devs/armv8_cortex_*
148 if test -d "$i"
153 if perf stat -e "$i_base/instructions/" true > /dev/null 2>&1
159 if test "x$pmu" = "x"
161 echo "cputype test [Skipped known PMU not found]"
165 # Test running with cputype produces output.
166 if ! perf stat --cputype="$pmu" -e instructions true 2>&1 | grep -E -q "instructions"
168 echo "cputype test [Failed count missed with given filter]"
172 echo "cputype test [Success]"
176 # Test the default stat command on hybrid devices opens one cycles event for
177 # each CPU type.
178 echo "hybrid test"
181 pmus=$(ls /sys/bus/event_source/devices/*/cpus 2>/dev/null | wc -l)
182 if [ "$pmus" -lt 1 ]
188 cycles_events=$(perf stat -- true 2>&1 | grep -E "/cycles/[uH]*| cycles[:uH]* " -c)
192 # can fall back to task-clock and so the end count may be 0. Fail if neither
194 if [ "$pmus" -ne "$cycles_events" ] && [ "0" -ne "$cycles_events" ]
196 echo "hybrid test [Found $pmus PMUs but $cycles_events cycles events. Failed]"
200 echo "hybrid test [Success]"