Skip to content

Commit 86b4997

Browse files
committed
ftrace: Fix prototypes for ftrace_startup/shutdown_subops()
The ftrace_startup_subops() was in the wrong header, and both functions were not defined on !CONFIG_DYNAMIC_FTRACE. 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: 5fccc75 ("ftrace: Add subops logic to allow one ops to manage many") 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 0ddef5d commit 86b4997

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

kernel/trace/ftrace_internal.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extern struct ftrace_ops global_ops;
1515
int ftrace_startup(struct ftrace_ops *ops, int command);
1616
int ftrace_shutdown(struct ftrace_ops *ops, int command);
1717
int ftrace_ops_test(struct ftrace_ops *ops, unsigned long ip, void *regs);
18+
int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command);
1819
int ftrace_shutdown_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command);
1920

2021
#else /* !CONFIG_DYNAMIC_FTRACE */
@@ -39,6 +40,14 @@ ftrace_ops_test(struct ftrace_ops *ops, unsigned long ip, void *regs)
3940
{
4041
return 1;
4142
}
43+
static inline int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command)
44+
{
45+
return -EINVAL;
46+
}
47+
static inline int ftrace_shutdown_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command)
48+
{
49+
return -EINVAL;
50+
}
4251
#endif /* CONFIG_DYNAMIC_FTRACE */
4352

4453
#ifdef CONFIG_FUNCTION_GRAPH_TRACER

kernel/trace/trace.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,6 @@ extern int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
11861186
int len, int reset);
11871187
extern int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
11881188
int len, int reset);
1189-
extern int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command);
11901189
#else
11911190
struct ftrace_func_command;
11921191

0 commit comments

Comments
 (0)