linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/tracing: Test only toplevel README file not the instances
@ 2025-01-16  0:17 Steven Rostedt
  2025-01-16  1:26 ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2025-01-16  0:17 UTC (permalink / raw)
  To: LKML, Linux Trace Kernel, linux-kselftest
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Shuah Khan

From: Steven Rostedt <rostedt@goodmis.org>

For the tests that have both a README attribute as well as the instance
flag to run the tests as an instance, the instance version will always
exit with UNSUPPORTED. That's because the instance directory does not
contain a README file. Currently, the tests check for a README file in the
directory that the test runs in and if there's a requirement for something
to be present in the README file, it will not find it, as the instance
directory doesn't have it.

Have the tests check if the current directory is an instance directory,
and if it is, check two directories above the current directory for the
README file:

  /sys/kernel/tracing/README
  /sys/kernel/tracing/instances/foo/../../README

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 tools/testing/selftests/ftrace/test.d/functions | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index 779f3e62ec90..9f2a67fbaf4d 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -156,7 +156,13 @@ check_requires() { # Check required files and tracers
                 exit_unsupported
             fi
         elif [ "$r" != "$i" ]; then
-            if ! grep -Fq "$r" README ; then
+	    # If this is an instance, check the top directory
+	    if echo $TRACING_DIR | grep -q "/instances/"; then
+		test="$TRACING_DIR/../.."
+	    else
+		test=$TRACING_DIR
+	    fi
+            if ! grep -Fq "$r" $test/README ; then
                 echo "Required feature pattern \"$r\" is not in README."
                 exit_unsupported
             fi
-- 
2.45.2


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

* Re: [PATCH] selftests/tracing: Test only toplevel README file not the instances
  2025-01-16  0:17 [PATCH] selftests/tracing: Test only toplevel README file not the instances Steven Rostedt
@ 2025-01-16  1:26 ` Steven Rostedt
  2025-01-23 21:56   ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2025-01-16  1:26 UTC (permalink / raw)
  To: LKML, Linux Trace Kernel, linux-kselftest
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Shuah Khan

On Wed, 15 Jan 2025 19:17:58 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: Steven Rostedt <rostedt@goodmis.org>
> 
> For the tests that have both a README attribute as well as the instance
> flag to run the tests as an instance, the instance version will always
> exit with UNSUPPORTED. That's because the instance directory does not
> contain a README file. Currently, the tests check for a README file in the
> directory that the test runs in and if there's a requirement for something
> to be present in the README file, it will not find it, as the instance
> directory doesn't have it.
> 
> Have the tests check if the current directory is an instance directory,
> and if it is, check two directories above the current directory for the
> README file:
> 
>   /sys/kernel/tracing/README
>   /sys/kernel/tracing/instances/foo/../../README

This is the same patch as:

  https://lore.kernel.org/all/20250116012041.326701057@goodmis.org/

But as there are other patches that depended on it, I just added this one
into a patch set with them. But decided not to make that patch set a v2 as
there was no changes with this one.

Damn, I forgot to add Shuah and kselftests mailing list to that one though :-p

-- Steve


> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  tools/testing/selftests/ftrace/test.d/functions | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> index 779f3e62ec90..9f2a67fbaf4d 100644
> --- a/tools/testing/selftests/ftrace/test.d/functions
> +++ b/tools/testing/selftests/ftrace/test.d/functions
> @@ -156,7 +156,13 @@ check_requires() { # Check required files and tracers
>                  exit_unsupported
>              fi
>          elif [ "$r" != "$i" ]; then
> -            if ! grep -Fq "$r" README ; then
> +	    # If this is an instance, check the top directory
> +	    if echo $TRACING_DIR | grep -q "/instances/"; then
> +		test="$TRACING_DIR/../.."
> +	    else
> +		test=$TRACING_DIR
> +	    fi
> +            if ! grep -Fq "$r" $test/README ; then
>                  echo "Required feature pattern \"$r\" is not in README."
>                  exit_unsupported
>              fi


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

* Re: [PATCH] selftests/tracing: Test only toplevel README file not the instances
  2025-01-16  1:26 ` Steven Rostedt
@ 2025-01-23 21:56   ` Shuah Khan
  2025-01-23 22:25     ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2025-01-23 21:56 UTC (permalink / raw)
  To: Steven Rostedt, LKML, Linux Trace Kernel, linux-kselftest
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Shuah Khan, Shuah Khan

On 1/15/25 18:26, Steven Rostedt wrote:
> On Wed, 15 Jan 2025 19:17:58 -0500
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
>> From: Steven Rostedt <rostedt@goodmis.org>
>>
>> For the tests that have both a README attribute as well as the instance
>> flag to run the tests as an instance, the instance version will always
>> exit with UNSUPPORTED. That's because the instance directory does not
>> contain a README file. Currently, the tests check for a README file in the
>> directory that the test runs in and if there's a requirement for something
>> to be present in the README file, it will not find it, as the instance
>> directory doesn't have it.
>>
>> Have the tests check if the current directory is an instance directory,
>> and if it is, check two directories above the current directory for the
>> README file:
>>
>>    /sys/kernel/tracing/README
>>    /sys/kernel/tracing/instances/foo/../../README
> 
> This is the same patch as:
> 
>    https://lore.kernel.org/all/20250116012041.326701057@goodmis.org/
> 
> But as there are other patches that depended on it, I just added this one
> into a patch set with them. But decided not to make that patch set a v2 as
> there was no changes with this one.
> 
> Damn, I forgot to add Shuah and kselftests mailing list to that one though :-p
> 

Do I need to do anything or is this taken care of?

thanks,
-- Shuah

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

* Re: [PATCH] selftests/tracing: Test only toplevel README file not the instances
  2025-01-23 21:56   ` Shuah Khan
@ 2025-01-23 22:25     ` Steven Rostedt
  2025-01-23 23:54       ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2025-01-23 22:25 UTC (permalink / raw)
  To: Shuah Khan
  Cc: LKML, Linux Trace Kernel, linux-kselftest, Masami Hiramatsu,
	Mathieu Desnoyers, Shuah Khan

On Thu, 23 Jan 2025 14:56:55 -0700
Shuah Khan <skhan@linuxfoundation.org> wrote:

> > 
> > Damn, I forgot to add Shuah and kselftests mailing list to that one though :-p
> >   
> 
> Do I need to do anything or is this taken care of?

I think you can take that series. If you want I can resend with you and the
mailing list Cc'd.

-- Steve

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

* Re: [PATCH] selftests/tracing: Test only toplevel README file not the instances
  2025-01-23 22:25     ` Steven Rostedt
@ 2025-01-23 23:54       ` Shuah Khan
  2025-02-20 16:18         ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2025-01-23 23:54 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linux Trace Kernel, linux-kselftest, Masami Hiramatsu,
	Mathieu Desnoyers, Shuah Khan, Shuah Khan

On 1/23/25 15:25, Steven Rostedt wrote:
> On Thu, 23 Jan 2025 14:56:55 -0700
> Shuah Khan <skhan@linuxfoundation.org> wrote:
> 
>>>
>>> Damn, I forgot to add Shuah and kselftests mailing list to that one though :-p
>>>    
>>
>> Do I need to do anything or is this taken care of?
> 
> I think you can take that series. If you want I can resend with you and the
> mailing list Cc'd.
> 

Yes please resend.

thanks,
-- Shuah

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

* Re: [PATCH] selftests/tracing: Test only toplevel README file not the instances
  2025-01-23 23:54       ` Shuah Khan
@ 2025-02-20 16:18         ` Shuah Khan
  2025-02-20 17:38           ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2025-02-20 16:18 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linux Trace Kernel, linux-kselftest, Masami Hiramatsu,
	Mathieu Desnoyers, Shuah Khan, Shuah Khan

On 1/23/25 16:54, Shuah Khan wrote:
> On 1/23/25 15:25, Steven Rostedt wrote:
>> On Thu, 23 Jan 2025 14:56:55 -0700
>> Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>>>>
>>>> Damn, I forgot to add Shuah and kselftests mailing list to that one though :-p
>>>
>>> Do I need to do anything or is this taken care of?
>>
>> I think you can take that series. If you want I can resend with you and the
>> mailing list Cc'd.
>>
> 
> Yes please resend.
> 

Steve, did you resend the series?

thanks,
-- Shuah

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

* Re: [PATCH] selftests/tracing: Test only toplevel README file not the instances
  2025-02-20 16:18         ` Shuah Khan
@ 2025-02-20 17:38           ` Steven Rostedt
  0 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2025-02-20 17:38 UTC (permalink / raw)
  To: Shuah Khan
  Cc: LKML, Linux Trace Kernel, linux-kselftest, Masami Hiramatsu,
	Mathieu Desnoyers, Shuah Khan

On Thu, 20 Feb 2025 09:18:09 -0700
Shuah Khan <skhan@linuxfoundation.org> wrote:

> On 1/23/25 16:54, Shuah Khan wrote:
> > On 1/23/25 15:25, Steven Rostedt wrote:  
> >> On Thu, 23 Jan 2025 14:56:55 -0700
> >> Shuah Khan <skhan@linuxfoundation.org> wrote:
> >>  
> >>>>
> >>>> Damn, I forgot to add Shuah and kselftests mailing list to that one though :-p  
> >>>
> >>> Do I need to do anything or is this taken care of?  
> >>
> >> I think you can take that series. If you want I can resend with you and the
> >> mailing list Cc'd.
> >>  
> > 
> > Yes please resend.
> >   
> 
> Steve, did you resend the series?
>

I may have forgotten to. Let me do that just in case.

-- Steve

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

end of thread, other threads:[~2025-02-20 17:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16  0:17 [PATCH] selftests/tracing: Test only toplevel README file not the instances Steven Rostedt
2025-01-16  1:26 ` Steven Rostedt
2025-01-23 21:56   ` Shuah Khan
2025-01-23 22:25     ` Steven Rostedt
2025-01-23 23:54       ` Shuah Khan
2025-02-20 16:18         ` Shuah Khan
2025-02-20 17:38           ` 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).