lkml.org 
[lkml]   [2026]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf test: Skip sched stats test for !root
Date
Running perf sched stats requires root and it fails to open the
schedstat file for regular users. Let's skip the test.

$ perf sched stats true
Failed to open /proc/sys/kernel/sched_schedstats

Cc: Swapnil Sapkal <swapnil.sapkal@amd.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/tests/shell/perf_sched_stats.sh | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/tools/perf/tests/shell/perf_sched_stats.sh b/tools/perf/tests/shell/perf_sched_stats.sh
index 2b1410b050d04737..41ee41fbf0253d55 100755
--- a/tools/perf/tests/shell/perf_sched_stats.sh
+++ b/tools/perf/tests/shell/perf_sched_stats.sh
@@ -4,6 +4,11 @@

set -e

+if [ "$(id -u)" != 0 ]; then
+ echo "[Skip] No root permission"
+ exit 2
+fi
+
err=0
test_perf_sched_stats_record() {
echo "Basic perf sched stats record test"
--
2.53.0

\
 
 \ /
  Last update: 2026-04-05 07:17    [W:0.102 / U:42.697 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog