linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/ftrace: Fix test to handle both old and new kernels
@ 2024-05-15  5:36 Steven Rostedt
  2024-06-14 16:43 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2024-05-15  5:36 UTC (permalink / raw)
  To: LKML, Linux trace kernel
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar, Shuah Khan,
	Shuah Khan, linux-kselftest

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

The function "scheduler_tick" was renamed to "sched_tick" and a selftest
that used that function for testing function trace filtering used that
function as part of the test.

But the change causes it to fail when run on older kernels. As tests
should not fail on older kernels, add a check to see which name is
available before testing.

Fixes: 86dd6c04ef9f2 ("sched/balancing: Rename scheduler_tick() => sched_tick()")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 .../ftrace/test.d/ftrace/func_set_ftrace_file.tc         | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
index 073a748b9380..263f6b798c85 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
@@ -19,7 +19,14 @@ fail() { # mesg
 
 FILTER=set_ftrace_filter
 FUNC1="schedule"
-FUNC2="sched_tick"
+if grep '^sched_tick\b' available_filter_functions; then
+    FUNC2="sched_tick"
+elif grep '^scheduler_tick\b' available_filter_functions; then
+    FUNC2="scheduler_tick"
+else
+    exit_unresolved
+fi
+
 
 ALL_FUNCS="#### all functions enabled ####"
 
-- 
2.43.0


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

* Re: [PATCH] selftests/ftrace: Fix test to handle both old and new kernels
  2024-05-15  5:36 [PATCH] selftests/ftrace: Fix test to handle both old and new kernels Steven Rostedt
@ 2024-06-14 16:43 ` Steven Rostedt
  2024-08-19 19:20   ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2024-06-14 16:43 UTC (permalink / raw)
  To: LKML, Linux trace kernel
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar, Shuah Khan,
	Shuah Khan, linux-kselftest


Shuah,

Can you take this through your tree?

Thanks,

-- Steve


On Wed, 15 May 2024 01:36:20 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> The function "scheduler_tick" was renamed to "sched_tick" and a selftest
> that used that function for testing function trace filtering used that
> function as part of the test.
> 
> But the change causes it to fail when run on older kernels. As tests
> should not fail on older kernels, add a check to see which name is
> available before testing.
> 
> Fixes: 86dd6c04ef9f2 ("sched/balancing: Rename scheduler_tick() => sched_tick()")
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  .../ftrace/test.d/ftrace/func_set_ftrace_file.tc         | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
> index 073a748b9380..263f6b798c85 100644
> --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
> +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
> @@ -19,7 +19,14 @@ fail() { # mesg
>  
>  FILTER=set_ftrace_filter
>  FUNC1="schedule"
> -FUNC2="sched_tick"
> +if grep '^sched_tick\b' available_filter_functions; then
> +    FUNC2="sched_tick"
> +elif grep '^scheduler_tick\b' available_filter_functions; then
> +    FUNC2="scheduler_tick"
> +else
> +    exit_unresolved
> +fi
> +
>  
>  ALL_FUNCS="#### all functions enabled ####"
>  


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

* Re: [PATCH] selftests/ftrace: Fix test to handle both old and new kernels
  2024-06-14 16:43 ` Steven Rostedt
@ 2024-08-19 19:20   ` Steven Rostedt
  2024-08-21  6:58     ` Shuah Khan
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2024-08-19 19:20 UTC (permalink / raw)
  To: LKML, Linux trace kernel
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar, Shuah Khan,
	Shuah Khan, linux-kselftest

On Fri, 14 Jun 2024 12:43:22 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> Shuah,
> 
> Can you take this through your tree?

Ping.

-- Steve

> 
> Thanks,
> 
> -- Steve
> 
> 
> On Wed, 15 May 2024 01:36:20 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> > 
> > The function "scheduler_tick" was renamed to "sched_tick" and a selftest
> > that used that function for testing function trace filtering used that
> > function as part of the test.
> > 
> > But the change causes it to fail when run on older kernels. As tests
> > should not fail on older kernels, add a check to see which name is
> > available before testing.
> > 
> > Fixes: 86dd6c04ef9f2 ("sched/balancing: Rename scheduler_tick() => sched_tick()")
> > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> > ---
> >  .../ftrace/test.d/ftrace/func_set_ftrace_file.tc         | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
> > index 073a748b9380..263f6b798c85 100644
> > --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
> > @@ -19,7 +19,14 @@ fail() { # mesg
> >  
> >  FILTER=set_ftrace_filter
> >  FUNC1="schedule"
> > -FUNC2="sched_tick"
> > +if grep '^sched_tick\b' available_filter_functions; then
> > +    FUNC2="sched_tick"
> > +elif grep '^scheduler_tick\b' available_filter_functions; then
> > +    FUNC2="scheduler_tick"
> > +else
> > +    exit_unresolved
> > +fi
> > +
> >  
> >  ALL_FUNCS="#### all functions enabled ####"
> >    
> 


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

* Re: [PATCH] selftests/ftrace: Fix test to handle both old and new kernels
  2024-08-19 19:20   ` Steven Rostedt
@ 2024-08-21  6:58     ` Shuah Khan
  0 siblings, 0 replies; 4+ messages in thread
From: Shuah Khan @ 2024-08-21  6:58 UTC (permalink / raw)
  To: Steven Rostedt, LKML, Linux trace kernel
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar, Shuah Khan,
	Shuah Khan, linux-kselftest, Shuah Khan

On 8/19/24 13:20, Steven Rostedt wrote:
> On Fri, 14 Jun 2024 12:43:22 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
>> Shuah,
>>
>> Can you take this through your tree?
> 
> Ping.
> 
> -- Steve
> 
>>
>> Thanks,
>>
>> -- Steve
>>
>>
>> On Wed, 15 May 2024 01:36:20 -0400
>> Steven Rostedt <rostedt@goodmis.org> wrote:
>>
>>> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>>>
>>> The function "scheduler_tick" was renamed to "sched_tick" and a selftest
>>> that used that function for testing function trace filtering used that
>>> function as part of the test.
>>>
>>> But the change causes it to fail when run on older kernels. As tests
>>> should not fail on older kernels, add a check to see which name is
>>> available before testing.
>>>
>>> Fixes: 86dd6c04ef9f2 ("sched/balancing: Rename scheduler_tick() => sched_tick()")
>>> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>


Sorry about the delay.

It is now applied to liniux-kselftest next for Linux 6.12-rc1.

thanks,
-- Shuah

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

end of thread, other threads:[~2024-08-21  6:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15  5:36 [PATCH] selftests/ftrace: Fix test to handle both old and new kernels Steven Rostedt
2024-06-14 16:43 ` Steven Rostedt
2024-08-19 19:20   ` Steven Rostedt
2024-08-21  6:58     ` 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).