]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
function_graph: Remove the use of FTRACE_NOTRACE_DEPTH
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Sun, 18 Nov 2018 23:44:04 +0000 (18:44 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sun, 9 Dec 2018 01:54:06 +0000 (20:54 -0500)
The curr_ret_stack is no longer set to a negative value when a function is
not to be traced by the function graph tracer. Remove the usage of
FTRACE_NOTRACE_DEPTH, as it is no longer needed.

Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
include/linux/ftrace.h
kernel/trace/fgraph.c
kernel/trace/trace_functions_graph.c

index 10bd46434908b68a50c9b233cd3f6c682c48df55..98625f10d9828f352c2f0542ab0582e008f14e51 100644 (file)
@@ -790,7 +790,6 @@ unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx,
  */
 #define __notrace_funcgraph            notrace
 
-#define FTRACE_NOTRACE_DEPTH 65536
 #define FTRACE_RETFUNC_DEPTH 50
 #define FTRACE_RETSTACK_ALLOC_SIZE 32
 extern int register_ftrace_graph(trace_func_graph_ret_t retfunc,
index e852b69c0e64bb03cd6e0f2fa467c78f1d4f45e7..de887a983ac7351805cb84bcc34f3672685c1a92 100644 (file)
@@ -112,16 +112,6 @@ ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret,
 
        index = current->curr_ret_stack;
 
-       /*
-        * A negative index here means that it's just returned from a
-        * notrace'd function.  Recover index to get an original
-        * return address.  See ftrace_push_return_trace().
-        *
-        * TODO: Need to check whether the stack gets corrupted.
-        */
-       if (index < 0)
-               index += FTRACE_NOTRACE_DEPTH;
-
        if (unlikely(index < 0 || index >= FTRACE_RETFUNC_DEPTH)) {
                ftrace_graph_stop();
                WARN_ON(1);
@@ -190,15 +180,6 @@ unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
         */
        barrier();
        current->curr_ret_stack--;
-       /*
-        * The curr_ret_stack can be less than -1 only if it was
-        * filtered out and it's about to return from the function.
-        * Recover the index and continue to trace normal functions.
-        */
-       if (current->curr_ret_stack < -1) {
-               current->curr_ret_stack += FTRACE_NOTRACE_DEPTH;
-               return ret;
-       }
 
        if (unlikely(!ret)) {
                ftrace_graph_stop();
index ecf543df943bb411fa499b029cd63113dcc56f3f..eaf9b1629956565768c53ba4371161c44b15bd61 100644 (file)
@@ -115,9 +115,6 @@ unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx,
        if (ret != (unsigned long)return_to_handler)
                return ret;
 
-       if (index < -1)
-               index += FTRACE_NOTRACE_DEPTH;
-
        if (index < 0)
                return ret;
 
@@ -675,10 +672,6 @@ print_graph_entry_leaf(struct trace_iterator *iter,
 
                cpu_data = per_cpu_ptr(data->cpu_data, cpu);
 
-               /* If a graph tracer ignored set_graph_notrace */
-               if (call->depth < -1)
-                       call->depth += FTRACE_NOTRACE_DEPTH;
-
                /*
                 * Comments display at + 1 to depth. Since
                 * this is a leaf function, keep the comments
@@ -721,10 +714,6 @@ print_graph_entry_nested(struct trace_iterator *iter,
                struct fgraph_cpu_data *cpu_data;
                int cpu = iter->cpu;
 
-               /* If a graph tracer ignored set_graph_notrace */
-               if (call->depth < -1)
-                       call->depth += FTRACE_NOTRACE_DEPTH;
-
                cpu_data = per_cpu_ptr(data->cpu_data, cpu);
                cpu_data->depth = call->depth;