stat_all_pmu.sh 739 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. # perf all PMU test
  3. # SPDX-License-Identifier: GPL-2.0
  4. set -e
  5. # Test all PMU events; however exclude parameterized ones (name contains '?')
  6. for p in $(perf list --raw-dump pmu | sed 's/[[:graph:]]\+?[[:graph:]]\+[[:space:]]//g'); do
  7. echo "Testing $p"
  8. result=$(perf stat -e "$p" true 2>&1)
  9. if ! echo "$result" | grep -q "$p" && ! echo "$result" | grep -q "<not supported>" ; then
  10. # We failed to see the event and it is supported. Possibly the workload was
  11. # too small so retry with something longer.
  12. result=$(perf stat -e "$p" perf bench internals synthesize 2>&1)
  13. if ! echo "$result" | grep -q "$p" ; then
  14. echo "Event '$p' not printed in:"
  15. echo "$result"
  16. exit 1
  17. fi
  18. fi
  19. done
  20. exit 0