Skip to content

Commit 2fa717a

Browse files
committed
ftrace: Do not process STUB functions in ftrace_ops_list_func()
The function_graph tracer has a stub function and its ops flag has the FTRACE_OPS_FL_STUB set. As the function graph does not use the ftrace_ops->func pointer but instead is called by a separate part of the ftrace trampoline. The function_graph tracer still requires to pass in a ftrace_ops that may also hold the hash of the functions to call. But there's no reason to test that hash in the function tracing portion. Instead of testing to see if we should call the stub function, just test if the ops has FTRACE_OPS_FL_STUB set, and just skip it. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent ee6a650 commit 2fa717a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎kernel/trace/ftrace.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6260,6 +6260,9 @@ __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
62606260
preempt_disable_notrace();
62616261

62626262
do_for_each_ftrace_op(op, ftrace_ops_list) {
6263+
/* Stub functions don't need to be called nor tested */
6264+
if (op->flags & FTRACE_OPS_FL_STUB)
6265+
continue;
62636266
/*
62646267
* Check the following for each ops before calling their func:
62656268
* if RCU flag is set, then rcu_is_watching() must be true

0 commit comments

Comments
 (0)