OSDN Git Service

Merge tag 'memblock-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt...
[uclinux-h8/linux.git] / tools / perf / tests / shell / stat_all_metrics.sh
1 #!/bin/sh
2 # perf all metrics test
3 # SPDX-License-Identifier: GPL-2.0
4
5 set -e
6
7 for m in $(perf list --raw-dump metrics); do
8   echo "Testing $m"
9   result=$(perf stat -M "$m" true 2>&1)
10   if [[ ! "$result" =~ "$m" ]] && [[ ! "$result" =~ "<not supported>" ]]; then
11     # We failed to see the metric and the events are support. Possibly the
12     # workload was too small so retry with something longer.
13     result=$(perf stat -M "$m" perf bench internals synthesize 2>&1)
14     if [[ ! "$result" =~ "$m" ]]; then
15       echo "Metric '$m' not printed in:"
16       echo "$result"
17       exit 1
18     fi
19   fi
20 done
21
22 exit 0