ftrace: Remove unused global 'ftrace_direct_func_count'
authorDr. David Alan Gilbert <linux@treblig.org>
Mon, 6 May 2024 23:33:05 +0000 (00:33 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 14 May 2024 06:09:40 +0000 (02:09 -0400)
Commit 8788ca164eb4b ("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.org
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/linux/ftrace.h
kernel/trace/fgraph.c
kernel/trace/ftrace.c

index b01cca36147ff2b67b54e52e150ca9573d23e242..e3a83ebd1b333fb72f683e02a684373d0ed20282 100644 (file)
@@ -413,7 +413,6 @@ struct ftrace_func_entry {
 };
 
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
-extern int ftrace_direct_func_count;
 unsigned long ftrace_find_rec_direct(unsigned long ip);
 int register_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);
 
 #else
 struct ftrace_ops;
-# define ftrace_direct_func_count 0
 static inline unsigned long ftrace_find_rec_direct(unsigned long ip)
 {
        return 0;
index c83c005e654e3fed617fcc1e05359f06aa0ed74e..a130b2d898f7cc0d9825e31fc5db171c5992ef58 100644 (file)
@@ -125,17 +125,6 @@ int function_graph_enter(unsigned long ret, unsigned long func,
 {
        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.depth = ++current->curr_ret_depth;
 
index 4613bf67ef2c05ba2caf05b7aaf88b38b93e213d..5a01d72f66db534d9a632ee6ca1d8828c14896a9 100644 (file)
@@ -2538,7 +2538,6 @@ ftrace_find_unique_ops(struct dyn_ftrace *rec)
 /* Protected by rcu_tasks for reading, and direct_mutex for writing */
 static struct ftrace_hash __rcu *direct_functions = EMPTY_HASH;
 static DEFINE_MUTEX(direct_mutex);
-int ftrace_direct_func_count;
 
 /*
  * Search the direct_functions hash to see if the given instruction pointer