Skip to content

Commit 2a08386

Browse files
ftrace: Remove unused global 'ftrace_direct_func_count'
JIRA: https://issues.redhat.com/browse/RHEL-101598 commit d2cc859 Author: Dr. David Alan Gilbert <linux@treblig.org> Date: Tue May 7 00:33:05 2024 +0100 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> Conflicts: - Minor context change due to missing commit d05cb47 ("ftrace: Fix modification of direct_function hash while in use") Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
1 parent ba028c6 commit 2a08386

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
@@ -397,7 +397,6 @@ struct ftrace_func_entry {
397397
};
398398

399399
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
400-
extern int ftrace_direct_func_count;
401400
unsigned long ftrace_find_rec_direct(unsigned long ip);
402401
int register_ftrace_direct(struct ftrace_ops *ops, unsigned long addr);
403402
int unregister_ftrace_direct(struct ftrace_ops *ops, unsigned long addr,
@@ -409,7 +408,6 @@ void ftrace_stub_direct_tramp(void);
409408

410409
#else
411410
struct ftrace_ops;
412-
# define ftrace_direct_func_count 0
413411
static inline unsigned long ftrace_find_rec_direct(unsigned long ip)
414412
{
415413
return 0;

kernel/trace/fgraph.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,6 @@ int function_graph_enter(unsigned long ret, unsigned long func,
135135
{
136136
struct ftrace_graph_ent trace;
137137

138-
#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
139-
/*
140-
* Skip graph tracing if the return location is served by direct trampoline,
141-
* since call sequence and return addresses are unpredictable anyway.
142-
* Ex: BPF trampoline may call original function and may skip frame
143-
* depending on type of BPF programs attached.
144-
*/
145-
if (ftrace_direct_func_count &&
146-
ftrace_find_rec_direct(ret - MCOUNT_INSN_SIZE))
147-
return -EBUSY;
148-
#endif
149138
trace.func = func;
150139
trace.depth = ++current->curr_ret_depth;
151140

kernel/trace/ftrace.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,6 @@ ftrace_find_unique_ops(struct dyn_ftrace *rec)
25332533
/* Protected by rcu_tasks for reading, and direct_mutex for writing */
25342534
static struct ftrace_hash *direct_functions = EMPTY_HASH;
25352535
static DEFINE_MUTEX(direct_mutex);
2536-
int ftrace_direct_func_count;
25372536

25382537
/*
25392538
* Search the direct_functions hash to see if the given instruction pointer

0 commit comments

Comments
 (0)