aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/tests/shell/stat_all_metricgroups.sh
blob: 55ef9c9ded2d71d02f69b0ba8107ae913a22b820 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# perf all metricgroups test
# SPDX-License-Identifier: GPL-2.0

set -e

ParanoidAndNotRoot()
{
  [ "$(id -u)" != 0 ] && [ "$(cat /proc/sys/kernel/perf_event_paranoid)" -gt $1 ]
}

system_wide_flag="-a"
if ParanoidAndNotRoot 0
then
  system_wide_flag=""
fi

for m in $(perf list --raw-dump metricgroups)
do
  echo "Testing $m"
  perf stat -M "$m" $system_wide_flag sleep 0.01
done

exit 0