drm/rockchip: Don't change hdmi reference clock rate
[drm/drm-misc.git] / tools / perf / tests / shell / stat_all_pmu.sh
blob8b148b300be1131ecacb4c807b9f181890c719b2
1 #!/bin/bash
2 # perf all PMU test (exclusive)
3 # SPDX-License-Identifier: GPL-2.0
5 set -e
6 err=0
7 result=""
9 trap_cleanup() {
10 echo "Unexpected signal in ${FUNCNAME[1]}"
11 echo "$result"
12 exit 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')
19 echo "Testing $p"
20 result=$(perf stat -e "$p" true 2>&1)
21 if echo "$result" | grep -q "$p"
22 then
23 # Event seen in output.
24 continue
26 if echo "$result" | grep -q "<not supported>"
27 then
28 # Event not supported, so ignore.
29 continue
31 if echo "$result" | grep -q "Access to performance monitoring and observability operations is limited."
32 then
33 # Access is limited, so ignore.
34 continue
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"
41 then
42 # Event seen in output.
43 continue
45 echo "Error: event '$p' not printed in:"
46 echo "$result"
47 err=1
48 done
50 trap - EXIT TERM INT
51 exit $err