Skip to content

Commit

Permalink
tracing: Fix graph tracer with stack tracer on other archs
Browse files Browse the repository at this point in the history
Running my ftrace tests on PowerPC, it failed the test that checks
if function_graph tracer is affected by the stack tracer. It was.
Looking into this, I found that the update_function_graph_func()
must be called even if the trampoline function is not changed.
This is because archs like PowerPC do not support ftrace_ops being
passed by assembly and instead uses a helper function (what the
trampoline function points to). Since this function is not changed
even when multiple ftrace_ops are added to the code, the test that
falls out before calling update_function_graph_func() will miss that
the update must still be done.

Call update_function_graph_function() for all calls to
update_ftrace_function()

Cc: stable@vger.kernel.org # 3.3+
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed Jul 15, 2014
1 parent 8abfb87 commit 5f8bf2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ static void update_ftrace_function(void)
func = ftrace_ops_list_func;
}

update_function_graph_func();

/* If there's no change, then do nothing more here */
if (ftrace_trace_function == func)
return;

update_function_graph_func();

/*
* If we are using the list function, it doesn't care
* about the function_trace_ops.
Expand Down

0 comments on commit 5f8bf2d

Please sign in to comment.