public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf test: Skip sched stats test for !root
@ 2026-04-05  5:16 Namhyung Kim
  2026-04-05 17:19 ` Ian Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Namhyung Kim @ 2026-04-05  5:16 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, James Clark
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, Swapnil Sapkal

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf test: Skip sched stats test for !root
  2026-04-05  5:16 [PATCH] perf test: Skip sched stats test for !root Namhyung Kim
@ 2026-04-05 17:19 ` Ian Rogers
  2026-04-06  5:29 ` Swapnil Sapkal
  2026-04-06 17:51 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2026-04-05 17:19 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, James Clark, Jiri Olsa, Adrian Hunter,
	Peter Zijlstra, Ingo Molnar, LKML, linux-perf-users,
	Swapnil Sapkal

On Sat, Apr 4, 2026 at 10:16 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> 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>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf test: Skip sched stats test for !root
  2026-04-05  5:16 [PATCH] perf test: Skip sched stats test for !root Namhyung Kim
  2026-04-05 17:19 ` Ian Rogers
@ 2026-04-06  5:29 ` Swapnil Sapkal
  2026-04-06 17:51 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Swapnil Sapkal @ 2026-04-06  5:29 UTC (permalink / raw)
  To: Namhyung Kim, Arnaldo Carvalho de Melo, Ian Rogers, James Clark
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users

Hi Namhyung,

On 05-04-2026 10:46, Namhyung Kim wrote:
> 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>

Tested-by: Swapnil Sapkal <swapnil.sapkal@amd.com>

--
Thanks and Regards,
Swapnil

> ---
>   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"


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf test: Skip sched stats test for !root
  2026-04-05  5:16 [PATCH] perf test: Skip sched stats test for !root Namhyung Kim
  2026-04-05 17:19 ` Ian Rogers
  2026-04-06  5:29 ` Swapnil Sapkal
@ 2026-04-06 17:51 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2026-04-06 17:51 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, James Clark
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, Swapnil Sapkal

On Sat, Apr 04, 2026 at 10:16:44PM -0700, Namhyung Kim wrote:
> 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>

Applied to perf-tools-next, thanks!

Best regards,
Namhyung


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-06 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-05  5:16 [PATCH] perf test: Skip sched stats test for !root Namhyung Kim
2026-04-05 17:19 ` Ian Rogers
2026-04-06  5:29 ` Swapnil Sapkal
2026-04-06 17:51 ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox