Skip to contentSkip to conversation

tracing: Fix selftest config check for function graph start up test

PATCH Superseded Steven Rostedt 2 participants 3 messages Oct 21, 2021 Tracing

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 tracing: Fix selftest config check for function graph start up test

From: "Steven Rostedt (VMware)" <[email protected]>

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.

---
Fixes this patch:
https://lore.kernel.org/all/[email protected]/

 kernel/trace/trace_selftest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/trace/trace_selftest.c +2 -1
index 3404a245417e..3db8b80fbdca 100644
@@ -845,7 +845,8 @@ trace_selftest_startup_function_graph(struct tracer *trace,
 		goto out;
 	}
 
-#ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
+#if defined(CONFIG_DYNAMIC_FTRACE) && \
+    defined(CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS)
 	tracing_reset_online_cpus(&tr->array_buffer);
 	set_graph_array(tr);
 
Signature · 1 line
2.31.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Steven Rostedt

From: "Steven Rostedt (VMware)" <[email protected]>

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.

oops, I assumed id depended on CONFIG_DYNAMIC_FTRACE, but did not check..

thanks,
jirka

Quoted 24 lines

---
Fixes this patch:

   https://lore.kernel.org/all/[email protected]/
 kernel/trace/trace_selftest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/trace/trace_selftest.c +2 -1
index 3404a245417e..3db8b80fbdca 100644
@@ -845,7 +845,8 @@ trace_selftest_startup_function_graph(struct tracer *trace,
 		goto out;
 	}
 
-#ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
+#if defined(CONFIG_DYNAMIC_FTRACE) && \
+    defined(CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS)
 	tracing_reset_online_cpus(&tr->array_buffer);
 	set_graph_array(tr);
 
Signature · 1 line
2.31.1
author maintainer
#2 lore raw
Quoted 2 lines · On Thu, 21 Oct 2021 18:47:30 +0200 Jiri Olsa <[email protected]> wrote:

oops, I assumed id depended on CONFIG_DYNAMIC_FTRACE, but did not check..

And I need to make a v2....

My cross compile tests are now failing :-/

/work/build/trace/nobackup/cross-linux.git/kernel/trace/trace_selftest.c:787:32: warning: 'trace_direct_tramp' defined but not used [-Wunused-function]

New patch on its way.

-- Steve