Skip to content

Commit 4057fd2

Browse files
committed
function_graph: Do not update pid func if CONFIG_DYNAMIC_FTRACE not enabled
The ftrace subops is only defined if CONFIG_DYNAMIC_FTRACE is enabled. If it is not, function tracing is extremely limited, and the subops in the ftrace_ops structure is not defined (and will fail to compile). If DYNAMIC_FTRACE is not enabled, then function graph filtering will not work (as it shouldn't). Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Fixes: df3ec5d ("function_graph: Add pid tracing back to function graph tracer") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 0c4d8cb commit 4057fd2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/trace/fgraph.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,7 @@ void fgraph_update_pid_func(void)
11771177
if (!(graph_ops.flags & FTRACE_OPS_FL_INITIALIZED))
11781178
return;
11791179

1180+
#ifdef CONFIG_DYNAMIC_FTRACE
11801181
list_for_each_entry(op, &graph_ops.subop_list, list) {
11811182
if (op->flags & FTRACE_OPS_FL_PID) {
11821183
gops = container_of(op, struct fgraph_ops, ops);
@@ -1186,6 +1187,7 @@ void fgraph_update_pid_func(void)
11861187
static_call_update(fgraph_func, gops->entryfunc);
11871188
}
11881189
}
1190+
#endif
11891191
}
11901192

11911193
/* Allocate a return stack for each task */

0 commit comments

Comments
 (0)