2 # perf all PMU test (exclusive)
3 # SPDX-License-Identifier: GPL-2.0
10 echo "Unexpected signal in ${FUNCNAME[1]}"
14 trap trap_cleanup EXIT TERM INT
16 # Test all PMU events; however exclude parameterized ones (name contains '?')
17 for p
in $
(perf list
--raw-dump pmu |
sed 's/[[:graph:]]\+?[[:graph:]]\+[[:space:]]//g')
20 result
=$
(perf stat
-e "$p" true
2>&1)
21 if echo "$result" |
grep -q "$p"
23 # Event seen in output.
26 if echo "$result" |
grep -q "<not supported>"
28 # Event not supported, so ignore.
31 if echo "$result" |
grep -q "Access to performance monitoring and observability operations is limited."
33 # Access is limited, so ignore.
37 # We failed to see the event and it is supported. Possibly the workload was
38 # too small so retry with something longer.
39 result
=$
(perf stat
-e "$p" perf bench internals synthesize
2>&1)
40 if echo "$result" |
grep -q "$p"
42 # Event seen in output.
45 echo "Error: event '$p' not printed in:"