Skip to content

Commit

Permalink
ftrace: Make ftrace_location() a nop on !DYNAMIC_FTRACE
Browse files Browse the repository at this point in the history
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/20120612225426.961092717@goodmis.org

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jul 31, 2012
1 parent 2576428 commit 4dc9367
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ extern int skip_trace(unsigned long ip);

extern void ftrace_disable_daemon(void);
extern void ftrace_enable_daemon(void);
#else
#else /* CONFIG_DYNAMIC_FTRACE */
static inline int skip_trace(unsigned long ip) { return 0; }
static inline int ftrace_force_update(void) { return 0; }
static inline void ftrace_disable_daemon(void) { }
Expand All @@ -538,6 +538,10 @@ static inline int ftrace_text_reserved(void *start, void *end)
{
return 0;
}
static inline unsigned long ftrace_location(unsigned long ip)
{
return 0;
}

/*
* Again users of functions that have ftrace_ops may not
Expand Down

0 comments on commit 4dc9367

Please sign in to comment.