mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 01:13:11 +00:00
Running shellcheck on stat_all_metricgroups.sh reports below warning: In ./tests/shell/stat_all_metricgroups.sh line 7: function ParanoidAndNotRoot() ^-- SC2112: 'function' keyword is non-standard. Delete it. As per the format, "function" is a non-standard keyword that can be used to declare functions. Fix this by removing the "function" keyword from ParanoidAndNotRoot function Signed-off-by: Athira Rajeev <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
25 lines
399 B
Bash
Executable File
25 lines
399 B
Bash
Executable File
#!/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
|