2 # perf all metrics test
3 # SPDX-License-Identifier: GPL-2.0
7 [ "$(id -u)" != 0 ] && [ "$(cat /proc/sys/kernel/perf_event_paranoid)" -gt $1 ]
11 if ParanoidAndNotRoot
0
17 for m
in $
(perf list
--raw-dump metrics
); do
19 result
=$
(perf stat
-M "$m" $system_wide_flag -- sleep 0.01 2>&1)
21 if [[ $result_err -gt 0 ]]
24 "Access to performance monitoring and observability operations is limited" ]]
26 echo "Permission failure"
33 elif [[ "$result" =~
"in per-thread mode, enable system wide" ]]
35 echo "Permissions - need system wide mode"
42 elif [[ "$result" =~
"<not supported>" ]]
44 echo "Not supported events"
51 elif [[ "$result" =~
"FP_ARITH" ||
"$result" =~
"AMX" ]]
60 elif [[ "$result" =~
"PMM" ]]
62 echo "Optane memory issues"
72 if [[ "$result" =~
${m:0:50} ]]
77 # Failed, possibly the workload was too small so retry with something longer.
78 result
=$
(perf stat
-M "$m" $system_wide_flag -- perf bench internals synthesize
2>&1)
79 if [[ "$result" =~
${m:0:50} ]]
83 echo "Metric '$m' not printed in:"