public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tracing: Fix selftest config check for function graph start up test
@ 2021-10-21 17:43 Steven Rostedt
  2021-10-21 18:10 ` Jiri Olsa
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2021-10-21 17:43 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Andrew Morton, Jiri Olsa

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

There's a new test in trace_selftest_startup_function_graph() that
requires the use of ftrace args being supported as well does some tricks
with dynamic tracing. Although this code checks HAVE_DYNAMIC_FTRACE_WITH_ARGS
it fails to check DYNAMIC_FTRACE, and the kernel fails to build due to
that dependency.

Also only define the prototype of trace_direct_tramp() if it is used.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Changes since v1:
   https://lkml.kernel.org/r/20211021123729.23be20c4@gandalf.local.home
   - Hide trace_direct_tramp() when not used

 kernel/trace/trace_selftest.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index 3404a245417e..afd937a46496 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -784,7 +784,11 @@ static struct fgraph_ops fgraph_ops __initdata  = {
 	.retfunc		= &trace_graph_return,
 };
 
+#if defined(CONFIG_DYNAMIC_FTRACE) && \
+    defined(CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS)
+#define TEST_DIRECT_TRAMP
 noinline __noclone static void trace_direct_tramp(void) { }
+#endif
 
 /*
  * Pretty much the same than for the function tracer from which the selftest
@@ -845,7 +849,7 @@ trace_selftest_startup_function_graph(struct tracer *trace,
 		goto out;
 	}
 
-#ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
+#ifdef TEST_DIRECT_TRAMP
 	tracing_reset_online_cpus(&tr->array_buffer);
 	set_graph_array(tr);
 
-- 
2.31.1


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

* Re: [PATCH v2] tracing: Fix selftest config check for function graph start up test
  2021-10-21 17:43 [PATCH v2] tracing: Fix selftest config check for function graph start up test Steven Rostedt
@ 2021-10-21 18:10 ` Jiri Olsa
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Olsa @ 2021-10-21 18:10 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Ingo Molnar, Andrew Morton

On Thu, Oct 21, 2021 at 01:43:57PM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> There's a new test in trace_selftest_startup_function_graph() that
> requires the use of ftrace args being supported as well does some tricks
> with dynamic tracing. Although this code checks HAVE_DYNAMIC_FTRACE_WITH_ARGS
> it fails to check DYNAMIC_FTRACE, and the kernel fails to build due to
> that dependency.
> 
> Also only define the prototype of trace_direct_tramp() if it is used.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> ---
> Changes since v1:
>    https://lkml.kernel.org/r/20211021123729.23be20c4@gandalf.local.home
>    - Hide trace_direct_tramp() when not used
> 
>  kernel/trace/trace_selftest.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
> index 3404a245417e..afd937a46496 100644
> --- a/kernel/trace/trace_selftest.c
> +++ b/kernel/trace/trace_selftest.c
> @@ -784,7 +784,11 @@ static struct fgraph_ops fgraph_ops __initdata  = {
>  	.retfunc		= &trace_graph_return,
>  };
>  
> +#if defined(CONFIG_DYNAMIC_FTRACE) && \
> +    defined(CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS)
> +#define TEST_DIRECT_TRAMP
>  noinline __noclone static void trace_direct_tramp(void) { }
> +#endif
>  
>  /*
>   * Pretty much the same than for the function tracer from which the selftest
> @@ -845,7 +849,7 @@ trace_selftest_startup_function_graph(struct tracer *trace,
>  		goto out;
>  	}
>  
> -#ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
> +#ifdef TEST_DIRECT_TRAMP
>  	tracing_reset_online_cpus(&tr->array_buffer);
>  	set_graph_array(tr);
>  
> -- 
> 2.31.1
> 


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

end of thread, other threads:[~2021-10-21 18:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 17:43 [PATCH v2] tracing: Fix selftest config check for function graph start up test Steven Rostedt
2021-10-21 18:10 ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox