linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/ftrace: Have pid filter test use instance flag
@ 2020-01-30 17:12 Steven Rostedt
  2020-01-30 17:13 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2020-01-30 17:12 UTC (permalink / raw)
  To: Shuah Khan; +Cc: LKML, Masami Hiramatsu, Namhyung Kim


From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

While running the ftracetests, the pid filter test failed because the
instance "foo" existed, and it was using it to rerun the test under a
instance named foo. The collision caused the test to fail as the mkdir
failed as the name already existed.

As of commit b5b77be812de7 ("selftests: ftrace: Allow some tests to be run
in a tracing instance") all a selftest needs to do to be tested in an
instance is to set the "instance" flag. There's no reason a selftest needs
to create an instance to run its test in an instance directly.

Remove the open coded testing in an instance for the pid filter test and
have it set the "instance" flag instead.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 .../selftests/ftrace/test.d/ftrace/func-filter-pid.tc     | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
index 64cfcc75e3c1..f2ee1e889e13 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
@@ -1,6 +1,7 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0
 # description: ftrace - function pid filters
+# flags: instance
 
 # Make sure that function pid matching filter works.
 # Also test it on an instance directory
@@ -96,13 +97,6 @@ do_test() {
 }
 
 do_test
-
-mkdir instances/foo
-cd instances/foo
-do_test
-cd ../../
-rmdir instances/foo
-
 do_reset
 
 exit 0
-- 
2.20.1


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

* Re: [PATCH] selftests/ftrace: Have pid filter test use instance flag
  2020-01-30 17:12 [PATCH] selftests/ftrace: Have pid filter test use instance flag Steven Rostedt
@ 2020-01-30 17:13 ` Steven Rostedt
  2020-01-31  0:10   ` Shuah Khan
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2020-01-30 17:13 UTC (permalink / raw)
  To: Shuah Khan; +Cc: LKML, Masami Hiramatsu, Namhyung Kim


Shuah,

Can you take this through your tree?

Thanks!

-- Steve


On Thu, 30 Jan 2020 12:12:05 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> While running the ftracetests, the pid filter test failed because the
> instance "foo" existed, and it was using it to rerun the test under a
> instance named foo. The collision caused the test to fail as the mkdir
> failed as the name already existed.
> 
> As of commit b5b77be812de7 ("selftests: ftrace: Allow some tests to be run
> in a tracing instance") all a selftest needs to do to be tested in an
> instance is to set the "instance" flag. There's no reason a selftest needs
> to create an instance to run its test in an instance directly.
> 
> Remove the open coded testing in an instance for the pid filter test and
> have it set the "instance" flag instead.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>  .../selftests/ftrace/test.d/ftrace/func-filter-pid.tc     | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
> index 64cfcc75e3c1..f2ee1e889e13 100644
> --- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
> +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
> @@ -1,6 +1,7 @@
>  #!/bin/sh
>  # SPDX-License-Identifier: GPL-2.0
>  # description: ftrace - function pid filters
> +# flags: instance
>  
>  # Make sure that function pid matching filter works.
>  # Also test it on an instance directory
> @@ -96,13 +97,6 @@ do_test() {
>  }
>  
>  do_test
> -
> -mkdir instances/foo
> -cd instances/foo
> -do_test
> -cd ../../
> -rmdir instances/foo
> -
>  do_reset
>  
>  exit 0


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

* Re: [PATCH] selftests/ftrace: Have pid filter test use instance flag
  2020-01-30 17:13 ` Steven Rostedt
@ 2020-01-31  0:10   ` Shuah Khan
  2020-01-31  2:41     ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2020-01-31  0:10 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Masami Hiramatsu, Namhyung Kim

On Thu, Jan 30, 2020 at 10:13 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
>
> Shuah,
>
> Can you take this through your tree?
>

Yes. I can take this. Could you please resend it to the addresses
listed by get_maintainers.pl
shuah@kernel.org or skhan@linuxfoundation.org and cc linux-kselftest
mailing list

thanks,
-- Shuah

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

* Re: [PATCH] selftests/ftrace: Have pid filter test use instance flag
  2020-01-31  0:10   ` Shuah Khan
@ 2020-01-31  2:41     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2020-01-31  2:41 UTC (permalink / raw)
  To: Shuah Khan; +Cc: LKML, Masami Hiramatsu, Namhyung Kim

On Thu, 30 Jan 2020 17:10:04 -0700
Shuah Khan <shuahkhan@gmail.com> wrote:

> On Thu, Jan 30, 2020 at 10:13 AM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> >
> > Shuah,
> >
> > Can you take this through your tree?
> >  
> 
> Yes. I can take this. Could you please resend it to the addresses
> listed by get_maintainers.pl
> shuah@kernel.org or skhan@linuxfoundation.org and cc linux-kselftest
> mailing list
> 

Sure, I just picked the address I had in my address book ;-)

-- Steve

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

end of thread, other threads:[~2020-01-31  2:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 17:12 [PATCH] selftests/ftrace: Have pid filter test use instance flag Steven Rostedt
2020-01-30 17:13 ` Steven Rostedt
2020-01-31  0:10   ` Shuah Khan
2020-01-31  2:41     ` Steven Rostedt

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