* [PATCH] tracing/selftests: Run the ownership test twice
@ 2024-05-23 16:45 Steven Rostedt
2024-05-24 0:47 ` Masami Hiramatsu
2024-06-14 16:41 ` Steven Rostedt
0 siblings, 2 replies; 5+ messages in thread
From: Steven Rostedt @ 2024-05-23 16:45 UTC (permalink / raw)
To: LKML, Linux Trace Kernel
Cc: Masami Hiramatsu, Mathieu Desnoyers, Ali Zahraee, Shuah Khan,
Shuah Khan, linux-kselftest, Linus Torvalds
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
A regression happened where running the ownership test passes on the first
iteration but fails running it a second time. This was caught and fixed,
but a later change brought it back. The regression was missed because the
automated tests only run the tests once per boot.
Change the ownership test to iterate through the tests twice, as this will
catch the regression with a single run.
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
.../ftrace/test.d/00basic/test_ownership.tc | 34 +++++++++++--------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
index c45094d1e1d2..71e43a92352a 100644
--- a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
+++ b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
@@ -83,32 +83,38 @@ run_tests() {
done
}
-mount -o remount,"$new_options" .
+# Run the tests twice as leftovers can cause issues
+for loop in 1 2 ; do
-run_tests
+ echo "Running iteration $loop"
-mount -o remount,"$mount_options" .
+ mount -o remount,"$new_options" .
-for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
- test "$d" $original_group
-done
+ run_tests
+
+ mount -o remount,"$mount_options" .
+
+ for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
+ test "$d" $original_group
+ done
# check instances as well
-chgrp $other_group instances
+ chgrp $other_group instances
-instance="$(mktemp -u test-XXXXXX)"
+ instance="$(mktemp -u test-XXXXXX)"
-mkdir instances/$instance
+ mkdir instances/$instance
-cd instances/$instance
+ cd instances/$instance
-run_tests
+ run_tests
-cd ../..
+ cd ../..
-rmdir instances/$instance
+ rmdir instances/$instance
-chgrp $original_group instances
+ chgrp $original_group instances
+done
exit 0
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing/selftests: Run the ownership test twice
2024-05-23 16:45 [PATCH] tracing/selftests: Run the ownership test twice Steven Rostedt
@ 2024-05-24 0:47 ` Masami Hiramatsu
2024-06-14 16:41 ` Steven Rostedt
1 sibling, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2024-05-24 0:47 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Linux Trace Kernel, Masami Hiramatsu, Mathieu Desnoyers,
Ali Zahraee, Shuah Khan, Shuah Khan, linux-kselftest,
Linus Torvalds
On Thu, 23 May 2024 12:45:41 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> A regression happened where running the ownership test passes on the first
> iteration but fails running it a second time. This was caught and fixed,
> but a later change brought it back. The regression was missed because the
> automated tests only run the tests once per boot.
>
> Change the ownership test to iterate through the tests twice, as this will
> catch the regression with a single run.
>
Looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks!
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> .../ftrace/test.d/00basic/test_ownership.tc | 34 +++++++++++--------
> 1 file changed, 20 insertions(+), 14 deletions(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> index c45094d1e1d2..71e43a92352a 100644
> --- a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> +++ b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> @@ -83,32 +83,38 @@ run_tests() {
> done
> }
>
> -mount -o remount,"$new_options" .
> +# Run the tests twice as leftovers can cause issues
> +for loop in 1 2 ; do
>
> -run_tests
> + echo "Running iteration $loop"
>
> -mount -o remount,"$mount_options" .
> + mount -o remount,"$new_options" .
>
> -for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
> - test "$d" $original_group
> -done
> + run_tests
> +
> + mount -o remount,"$mount_options" .
> +
> + for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
> + test "$d" $original_group
> + done
>
> # check instances as well
>
> -chgrp $other_group instances
> + chgrp $other_group instances
>
> -instance="$(mktemp -u test-XXXXXX)"
> + instance="$(mktemp -u test-XXXXXX)"
>
> -mkdir instances/$instance
> + mkdir instances/$instance
>
> -cd instances/$instance
> + cd instances/$instance
>
> -run_tests
> + run_tests
>
> -cd ../..
> + cd ../..
>
> -rmdir instances/$instance
> + rmdir instances/$instance
>
> -chgrp $original_group instances
> + chgrp $original_group instances
> +done
>
> exit 0
> --
> 2.43.0
>
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing/selftests: Run the ownership test twice
2024-05-23 16:45 [PATCH] tracing/selftests: Run the ownership test twice Steven Rostedt
2024-05-24 0:47 ` Masami Hiramatsu
@ 2024-06-14 16:41 ` Steven Rostedt
2024-08-07 20:29 ` Steven Rostedt
1 sibling, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2024-06-14 16:41 UTC (permalink / raw)
To: LKML, Linux Trace Kernel
Cc: Masami Hiramatsu, Mathieu Desnoyers, Ali Zahraee, Shuah Khan,
Shuah Khan, linux-kselftest, Linus Torvalds
Shuah,
Can you take this through your tree?
-- Steve
On Thu, 23 May 2024 12:45:41 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> A regression happened where running the ownership test passes on the first
> iteration but fails running it a second time. This was caught and fixed,
> but a later change brought it back. The regression was missed because the
> automated tests only run the tests once per boot.
>
> Change the ownership test to iterate through the tests twice, as this will
> catch the regression with a single run.
>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> .../ftrace/test.d/00basic/test_ownership.tc | 34 +++++++++++--------
> 1 file changed, 20 insertions(+), 14 deletions(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> index c45094d1e1d2..71e43a92352a 100644
> --- a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> +++ b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> @@ -83,32 +83,38 @@ run_tests() {
> done
> }
>
> -mount -o remount,"$new_options" .
> +# Run the tests twice as leftovers can cause issues
> +for loop in 1 2 ; do
>
> -run_tests
> + echo "Running iteration $loop"
>
> -mount -o remount,"$mount_options" .
> + mount -o remount,"$new_options" .
>
> -for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
> - test "$d" $original_group
> -done
> + run_tests
> +
> + mount -o remount,"$mount_options" .
> +
> + for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
> + test "$d" $original_group
> + done
>
> # check instances as well
>
> -chgrp $other_group instances
> + chgrp $other_group instances
>
> -instance="$(mktemp -u test-XXXXXX)"
> + instance="$(mktemp -u test-XXXXXX)"
>
> -mkdir instances/$instance
> + mkdir instances/$instance
>
> -cd instances/$instance
> + cd instances/$instance
>
> -run_tests
> + run_tests
>
> -cd ../..
> + cd ../..
>
> -rmdir instances/$instance
> + rmdir instances/$instance
>
> -chgrp $original_group instances
> + chgrp $original_group instances
> +done
>
> exit 0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing/selftests: Run the ownership test twice
2024-06-14 16:41 ` Steven Rostedt
@ 2024-08-07 20:29 ` Steven Rostedt
2024-08-07 20:49 ` Shuah Khan
0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2024-08-07 20:29 UTC (permalink / raw)
To: LKML, Linux Trace Kernel
Cc: Masami Hiramatsu, Mathieu Desnoyers, Ali Zahraee, Shuah Khan,
Shuah Khan, linux-kselftest, Linus Torvalds
On Fri, 14 Jun 2024 12:41:51 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> Shuah,
>
> Can you take this through your tree?
Ping!
-- Steve
>
> -- Steve
>
>
> On Thu, 23 May 2024 12:45:41 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> >
> > A regression happened where running the ownership test passes on the first
> > iteration but fails running it a second time. This was caught and fixed,
> > but a later change brought it back. The regression was missed because the
> > automated tests only run the tests once per boot.
> >
> > Change the ownership test to iterate through the tests twice, as this will
> > catch the regression with a single run.
> >
> > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> > ---
> > .../ftrace/test.d/00basic/test_ownership.tc | 34 +++++++++++--------
> > 1 file changed, 20 insertions(+), 14 deletions(-)
> >
> > diff --git a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> > index c45094d1e1d2..71e43a92352a 100644
> > --- a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
> > @@ -83,32 +83,38 @@ run_tests() {
> > done
> > }
> >
> > -mount -o remount,"$new_options" .
> > +# Run the tests twice as leftovers can cause issues
> > +for loop in 1 2 ; do
> >
> > -run_tests
> > + echo "Running iteration $loop"
> >
> > -mount -o remount,"$mount_options" .
> > + mount -o remount,"$new_options" .
> >
> > -for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
> > - test "$d" $original_group
> > -done
> > + run_tests
> > +
> > + mount -o remount,"$mount_options" .
> > +
> > + for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
> > + test "$d" $original_group
> > + done
> >
> > # check instances as well
> >
> > -chgrp $other_group instances
> > + chgrp $other_group instances
> >
> > -instance="$(mktemp -u test-XXXXXX)"
> > + instance="$(mktemp -u test-XXXXXX)"
> >
> > -mkdir instances/$instance
> > + mkdir instances/$instance
> >
> > -cd instances/$instance
> > + cd instances/$instance
> >
> > -run_tests
> > + run_tests
> >
> > -cd ../..
> > + cd ../..
> >
> > -rmdir instances/$instance
> > + rmdir instances/$instance
> >
> > -chgrp $original_group instances
> > + chgrp $original_group instances
> > +done
> >
> > exit 0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing/selftests: Run the ownership test twice
2024-08-07 20:29 ` Steven Rostedt
@ 2024-08-07 20:49 ` Shuah Khan
0 siblings, 0 replies; 5+ messages in thread
From: Shuah Khan @ 2024-08-07 20:49 UTC (permalink / raw)
To: Steven Rostedt, LKML, Linux Trace Kernel
Cc: Masami Hiramatsu, Mathieu Desnoyers, Ali Zahraee, Shuah Khan,
linux-kselftest, Linus Torvalds, Shuah Khan
On 8/7/24 14:29, Steven Rostedt wrote:
> On Fri, 14 Jun 2024 12:41:51 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
>> Shuah,
>>
>> Can you take this through your tree?
>
> Ping!
>
> -- Steve
>
Sorry for the delay.
Applied it o linux-kselftest next for Linux 6.12-rc1.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-07 20:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-23 16:45 [PATCH] tracing/selftests: Run the ownership test twice Steven Rostedt
2024-05-24 0:47 ` Masami Hiramatsu
2024-06-14 16:41 ` Steven Rostedt
2024-08-07 20:29 ` Steven Rostedt
2024-08-07 20:49 ` Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).