Commit d2cc859c authored by Dr. David Alan Gilbert's avatar Dr. David Alan Gilbert Committed by Steven Rostedt (Google)

ftrace: Remove unused global 'ftrace_direct_func_count'

Commit 8788ca16 ("ftrace: Remove the legacy _ftrace_direct API")
stopped setting the 'ftrace_direct_func_count' variable, but left
it around.  Clean it up.

Link: https://lore.kernel.org/linux-trace-kernel/20240506233305.215735-1-linux@treblig.orgSigned-off-by: default avatarDr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent c9d5b7b8
...@@ -413,7 +413,6 @@ struct ftrace_func_entry { ...@@ -413,7 +413,6 @@ struct ftrace_func_entry {
}; };
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
extern int ftrace_direct_func_count;
unsigned long ftrace_find_rec_direct(unsigned long ip); unsigned long ftrace_find_rec_direct(unsigned long ip);
int register_ftrace_direct(struct ftrace_ops *ops, unsigned long addr); int register_ftrace_direct(struct ftrace_ops *ops, unsigned long addr);
int unregister_ftrace_direct(struct ftrace_ops *ops, unsigned long addr, int unregister_ftrace_direct(struct ftrace_ops *ops, unsigned long addr,
...@@ -425,7 +424,6 @@ void ftrace_stub_direct_tramp(void); ...@@ -425,7 +424,6 @@ void ftrace_stub_direct_tramp(void);
#else #else
struct ftrace_ops; struct ftrace_ops;
# define ftrace_direct_func_count 0
static inline unsigned long ftrace_find_rec_direct(unsigned long ip) static inline unsigned long ftrace_find_rec_direct(unsigned long ip)
{ {
return 0; return 0;
......
...@@ -125,17 +125,6 @@ int function_graph_enter(unsigned long ret, unsigned long func, ...@@ -125,17 +125,6 @@ int function_graph_enter(unsigned long ret, unsigned long func,
{ {
struct ftrace_graph_ent trace; struct ftrace_graph_ent trace;
#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
/*
* Skip graph tracing if the return location is served by direct trampoline,
* since call sequence and return addresses are unpredictable anyway.
* Ex: BPF trampoline may call original function and may skip frame
* depending on type of BPF programs attached.
*/
if (ftrace_direct_func_count &&
ftrace_find_rec_direct(ret - MCOUNT_INSN_SIZE))
return -EBUSY;
#endif
trace.func = func; trace.func = func;
trace.depth = ++current->curr_ret_depth; trace.depth = ++current->curr_ret_depth;
......
...@@ -2538,7 +2538,6 @@ ftrace_find_unique_ops(struct dyn_ftrace *rec) ...@@ -2538,7 +2538,6 @@ ftrace_find_unique_ops(struct dyn_ftrace *rec)
/* Protected by rcu_tasks for reading, and direct_mutex for writing */ /* Protected by rcu_tasks for reading, and direct_mutex for writing */
static struct ftrace_hash __rcu *direct_functions = EMPTY_HASH; static struct ftrace_hash __rcu *direct_functions = EMPTY_HASH;
static DEFINE_MUTEX(direct_mutex); static DEFINE_MUTEX(direct_mutex);
int ftrace_direct_func_count;
/* /*
* Search the direct_functions hash to see if the given instruction pointer * Search the direct_functions hash to see if the given instruction pointer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment