perf test: Skip sched stats test for !root
Namhyung Kim
maintainerPATCH 1/1 perf test: Skip sched stats test for !root
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 <[email protected]>
Signed-off-by Namhyung Kim <[email protected]>
--- tools/perf/tests/shell/perf_sched_stats.sh | 5 +++++ 1 file changed, 5 insertions(+)
tools/perf/tests/shell/perf_sched_stats.sh +5 -0
@@ -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"
Signature · 1 line
2.53.0
Quoted 9 lines · Namhyung Kim
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_schedstatsCc Swapnil Sapkal <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
Reviewed-by Ian Rogers <[email protected]>
Thanks,
Ian
Quoted 23 lines
--- tools/perf/tests/shell/perf_sched_stats.sh | 5 +++++ 1 file changed, 5 insertions(+)tools/perf/tests/shell/perf_sched_stats.sh +5
-1@@ -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
Hi Namhyung,
Quoted 8 lines · Namhyung Kim
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_schedstatsCc Swapnil Sapkal <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
Tested-by Swapnil Sapkal <[email protected]>
--
Thanks and Regards,
Swapnil
Quoted 20 lines
--- tools/perf/tests/shell/perf_sched_stats.sh | 5 +++++ 1 file changed, 5 insertions(+)tools/perf/tests/shell/perf_sched_stats.sh +5
-0@@ -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"
Quoted 8 lines · Namhyung Kim
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_schedstatsCc Swapnil Sapkal <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
Applied to perf-tools-next, thanks!
Best regards,
Namhyung