Skip to content

Commit 4dc9367

Browse files
Steven Rostedtrostedt
authored andcommitted
ftrace: Make ftrace_location() a nop on !DYNAMIC_FTRACE
When CONFIG_DYNAMIC_FTRACE is not set, ftrace_location() is not defined. If a user (like kprobes) references this function, it will break the compile when CONFIG_DYNAMIC_FTRACE is not set. Add ftrace_location() as a nop (return 0) when DYNAMIC_FTRACE is not defined. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]>
1 parent 2576428 commit 4dc9367

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/linux/ftrace.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ extern int skip_trace(unsigned long ip);
520520

521521
extern void ftrace_disable_daemon(void);
522522
extern void ftrace_enable_daemon(void);
523-
#else
523+
#else /* CONFIG_DYNAMIC_FTRACE */
524524
static inline int skip_trace(unsigned long ip) { return 0; }
525525
static inline int ftrace_force_update(void) { return 0; }
526526
static inline void ftrace_disable_daemon(void) { }
@@ -538,6 +538,10 @@ static inline int ftrace_text_reserved(void *start, void *end)
538538
{
539539
return 0;
540540
}
541+
static inline unsigned long ftrace_location(unsigned long ip)
542+
{
543+
return 0;
544+
}
541545

542546
/*
543547
* Again users of functions that have ftrace_ops may not

0 commit comments

Comments
 (0)