Skip to content

Commit d2cc859

Browse files
Dr. David Alan Gilbertrostedt
authored andcommitted
ftrace: Remove unused global 'ftrace_direct_func_count'
Commit 8788ca1 ("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>
1 parent c9d5b7b commit d2cc859

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

include/linux/ftrace.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ struct ftrace_func_entry {
413413
};
414414

415415
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
416-
extern int ftrace_direct_func_count;
417416
unsigned long ftrace_find_rec_direct(unsigned long ip);
418417
int register_ftrace_direct(struct ftrace_ops *ops, unsigned long addr);
419418
int unregister_ftrace_direct(struct ftrace_ops *ops, unsigned long addr,
@@ -425,7 +424,6 @@ void ftrace_stub_direct_tramp(void);
425424

426425
#else
427426
struct ftrace_ops;
428-
# define ftrace_direct_func_count 0
429427
static inline unsigned long ftrace_find_rec_direct(unsigned long ip)
430428
{
431429
return 0;

kernel/trace/fgraph.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,6 @@ int function_graph_enter(unsigned long ret, unsigned long func,
125125
{
126126
struct ftrace_graph_ent trace;
127127

128-
#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
129-
/*
130-
* Skip graph tracing if the return location is served by direct trampoline,
131-
* since call sequence and return addresses are unpredictable anyway.
132-
* Ex: BPF trampoline may call original function and may skip frame
133-
* depending on type of BPF programs attached.
134-
*/
135-
if (ftrace_direct_func_count &&
136-
ftrace_find_rec_direct(ret - MCOUNT_INSN_SIZE))
137-
return -EBUSY;
138-
#endif
139128
trace.func = func;
140129
trace.depth = ++current->curr_ret_depth;
141130

kernel/trace/ftrace.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2538,7 +2538,6 @@ ftrace_find_unique_ops(struct dyn_ftrace *rec)
25382538
/* Protected by rcu_tasks for reading, and direct_mutex for writing */
25392539
static struct ftrace_hash __rcu *direct_functions = EMPTY_HASH;
25402540
static DEFINE_MUTEX(direct_mutex);
2541-
int ftrace_direct_func_count;
25422541

25432542
/*
25442543
* Search the direct_functions hash to see if the given instruction pointer

0 commit comments

Comments
 (0)