2020-05-05 10:19:34

by Po-Hsu Lin

[permalink] [raw]
Subject: [PATCH] selftests/ftrace: mark irqsoff_tracer.tc test as unresolved if the test module does not exist

The UNRESOLVED state is much more apporiate than the UNSUPPORTED state
for the absence of the test module, as it matches "test was set up
incorrectly" situation in the README file.

A possible scenario is that the function was enabled (supported by the
kernel) but the module was not installed properly, in this case we
cannot call this as UNSUPPORTED.

This change also make it consistent with other module-related tests
in ftrace.

Signed-off-by: Po-Hsu Lin <[email protected]>
---
.../testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
index cbd1743..2b82c80e 100644
--- a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
+++ b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
@@ -17,7 +17,14 @@ unsup() { #msg
exit_unsupported
}

-modprobe $MOD || unsup "$MOD module not available"
+unres() { #msg
+ reset_tracer
+ rmmod $MOD || true
+ echo $1
+ exit_unresolved
+}
+
+modprobe $MOD || unres "$MOD module not available"
rmmod $MOD

grep -q "preemptoff" available_tracers || unsup "preemptoff tracer not enabled"
--
2.7.4


2020-05-05 13:11:16

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: mark irqsoff_tracer.tc test as unresolved if the test module does not exist


You keep forgetting to Cc Shuah's other email.

On Tue, 5 May 2020 18:14:45 +0800
Po-Hsu Lin <[email protected]> wrote:

> The UNRESOLVED state is much more apporiate than the UNSUPPORTED state
> for the absence of the test module, as it matches "test was set up
> incorrectly" situation in the README file.
>
> A possible scenario is that the function was enabled (supported by the
> kernel) but the module was not installed properly, in this case we
> cannot call this as UNSUPPORTED.
>
> This change also make it consistent with other module-related tests
> in ftrace.

Acked-by: Steven Rostedt (VMware) <[email protected]>

Shuah,

Can you take this after Masami gives his ack (if he does that is).

Thanks,

-- Steve

>
> Signed-off-by: Po-Hsu Lin <[email protected]>
> ---
> .../testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> index cbd1743..2b82c80e 100644
> --- a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> +++ b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> @@ -17,7 +17,14 @@ unsup() { #msg
> exit_unsupported
> }
>
> -modprobe $MOD || unsup "$MOD module not available"
> +unres() { #msg
> + reset_tracer
> + rmmod $MOD || true
> + echo $1
> + exit_unresolved
> +}
> +
> +modprobe $MOD || unres "$MOD module not available"
> rmmod $MOD
>
> grep -q "preemptoff" available_tracers || unsup "preemptoff tracer not enabled"

2020-05-05 14:27:36

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: mark irqsoff_tracer.tc test as unresolved if the test module does not exist

On 5/5/20 7:09 AM, Steven Rostedt wrote:
>
> You keep forgetting to Cc Shuah's other email.
>
> On Tue, 5 May 2020 18:14:45 +0800
> Po-Hsu Lin <[email protected]> wrote:
>
>> The UNRESOLVED state is much more apporiate than the UNSUPPORTED state
>> for the absence of the test module, as it matches "test was set up
>> incorrectly" situation in the README file.
>>
>> A possible scenario is that the function was enabled (supported by the
>> kernel) but the module was not installed properly, in this case we
>> cannot call this as UNSUPPORTED.
>>
>> This change also make it consistent with other module-related tests
>> in ftrace.
>
> Acked-by: Steven Rostedt (VMware) <[email protected]>
>
> Shuah,
>
> Can you take this after Masami gives his ack (if he does that is).
>

Yes. I will wait for Masamis's Ack. Will do.

thanks,
-- Shuah

2020-05-06 01:49:02

by Po-Hsu Lin

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: mark irqsoff_tracer.tc test as unresolved if the test module does not exist

On Tue, May 5, 2020 at 9:09 PM Steven Rostedt <[email protected]> wrote:
>
>
> You keep forgetting to Cc Shuah's other email.
Thanks!
I got the recipients list from the get_mainter.pl.

>
> On Tue, 5 May 2020 18:14:45 +0800
> Po-Hsu Lin <[email protected]> wrote:
>
> > The UNRESOLVED state is much more apporiate than the UNSUPPORTED state
> > for the absence of the test module, as it matches "test was set up
> > incorrectly" situation in the README file.
> >
> > A possible scenario is that the function was enabled (supported by the
> > kernel) but the module was not installed properly, in this case we
> > cannot call this as UNSUPPORTED.
> >
> > This change also make it consistent with other module-related tests
> > in ftrace.
>
> Acked-by: Steven Rostedt (VMware) <[email protected]>
>
> Shuah,
>
> Can you take this after Masami gives his ack (if he does that is).
>
> Thanks,
>
> -- Steve
>
> >
> > Signed-off-by: Po-Hsu Lin <[email protected]>
> > ---
> > .../testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> > index cbd1743..2b82c80e 100644
> > --- a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> > @@ -17,7 +17,14 @@ unsup() { #msg
> > exit_unsupported
> > }
> >
> > -modprobe $MOD || unsup "$MOD module not available"
> > +unres() { #msg
> > + reset_tracer
> > + rmmod $MOD || true
> > + echo $1
> > + exit_unresolved
> > +}
> > +
> > +modprobe $MOD || unres "$MOD module not available"
> > rmmod $MOD
> >
> > grep -q "preemptoff" available_tracers || unsup "preemptoff tracer not enabled"
>

2020-05-06 15:48:32

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: mark irqsoff_tracer.tc test as unresolved if the test module does not exist

On 5/6/20 9:43 AM, Steven Rostedt wrote:
> On Wed, 6 May 2020 09:46:21 +0800
> Po-Hsu Lin <[email protected]> wrote:
>
>> On Tue, May 5, 2020 at 9:09 PM Steven Rostedt <[email protected]> wrote:
>>>
>>>
>>> You keep forgetting to Cc Shuah's other email.
>> Thanks!
>> I got the recipients list from the get_mainter.pl.
>
> Hmm.
>
> Seems like that is what get_maintainer.pl does:
>
> Steven Rostedt <[email protected]> (maintainer:TRACING)
> Ingo Molnar <[email protected]> (maintainer:TRACING)
> Shuah Khan <[email protected]> (maintainer:KERNEL SELFTEST FRAMEWORK)
> [email protected] (open list:KERNEL SELFTEST FRAMEWORK)
> [email protected] (open list)
>
> And looking at the code, it appears it will only take the first email
> address found in the file.
>
> Shuah, if you prefer the linuxfoundation.org email, you need to update
> MAINTAINERS file to have that one first.
>

When I updated the MAINTAINERS file, I was hoping both addresses will be
in the output. It doesn't appear to be working the way I assumed it
would. I will send in patch to update to switch them.

thanks,
-- Shuah

2020-05-06 19:26:31

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: mark irqsoff_tracer.tc test as unresolved if the test module does not exist

On Wed, 6 May 2020 09:46:21 +0800
Po-Hsu Lin <[email protected]> wrote:

> On Tue, May 5, 2020 at 9:09 PM Steven Rostedt <[email protected]> wrote:
> >
> >
> > You keep forgetting to Cc Shuah's other email.
> Thanks!
> I got the recipients list from the get_mainter.pl.

Hmm.

Seems like that is what get_maintainer.pl does:

Steven Rostedt <[email protected]> (maintainer:TRACING)
Ingo Molnar <[email protected]> (maintainer:TRACING)
Shuah Khan <[email protected]> (maintainer:KERNEL SELFTEST FRAMEWORK)
[email protected] (open list:KERNEL SELFTEST FRAMEWORK)
[email protected] (open list)

And looking at the code, it appears it will only take the first email
address found in the file.

Shuah, if you prefer the linuxfoundation.org email, you need to update
MAINTAINERS file to have that one first.

-- Steve

2020-05-07 08:53:17

by Masami Hiramatsu

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: mark irqsoff_tracer.tc test as unresolved if the test module does not exist

On Tue, 5 May 2020 18:14:45 +0800
Po-Hsu Lin <[email protected]> wrote:

> The UNRESOLVED state is much more apporiate than the UNSUPPORTED state
> for the absence of the test module, as it matches "test was set up
> incorrectly" situation in the README file.
>
> A possible scenario is that the function was enabled (supported by the
> kernel) but the module was not installed properly, in this case we
> cannot call this as UNSUPPORTED.
>
> This change also make it consistent with other module-related tests
> in ftrace.
>
> Signed-off-by: Po-Hsu Lin <[email protected]>

Looks good to me.

Acked-by: Masami Hiramatsu <[email protected]>

Thanks!

> ---
> .../testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> index cbd1743..2b82c80e 100644
> --- a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> +++ b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
> @@ -17,7 +17,14 @@ unsup() { #msg
> exit_unsupported
> }
>
> -modprobe $MOD || unsup "$MOD module not available"
> +unres() { #msg
> + reset_tracer
> + rmmod $MOD || true
> + echo $1
> + exit_unresolved
> +}
> +
> +modprobe $MOD || unres "$MOD module not available"
> rmmod $MOD
>
> grep -q "preemptoff" available_tracers || unsup "preemptoff tracer not enabled"
> --
> 2.7.4


--
Masami Hiramatsu <[email protected]>