2 # perf all libpfm4 events test
3 # SPDX-License-Identifier: GPL-2.0
5 if perf version
--build-options |
grep HAVE_LIBPFM |
grep -q OFF
7 echo "Skipping, no libpfm4 support"
12 for p
in $
(perf list
--raw-dump pfm
)
14 if echo "$p" |
grep -q unc_
16 echo "Skipping uncore event '$p' that may require additional options."
20 result
=$
(perf stat
--pfm-events "$p" true
2>&1)
22 if echo "$result" |
grep -q "failed to parse event $p : invalid or missing unit mask"
28 echo "Unexpected exit code '$x'"
31 if ! echo "$result" |
grep -q "$p" && ! echo "$result" |
grep -q "<not supported>"
33 # We failed to see the event and it is supported. Possibly the workload was
34 # too small so retry with something longer.
35 result
=$
(perf stat
--pfm-events "$p" perf bench internals synthesize
2>&1)
39 echo "Unexpected exit code '$x'"
42 if ! echo "$result" |
grep -q "$p"
44 echo "Event '$p' not printed in:"