ftrace/x86: Have static function tracing always test for function graph
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 24 Nov 2014 19:58:17 +0000 (14:58 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 24 Nov 2014 20:02:25 +0000 (15:02 -0500)
New updates to the ftrace generic code had ftrace_stub not always being
called when ftrace is off. This causes the static tracer to always save
and restore functions. But it also showed that when function tracing is
running, the function graph tracer can not. We should always check to see
if function graph tracing is running even if the function tracer is running
too. The function tracer code is not the only one that uses the hook to
function mcount.

Cc: Markos Chandras <Markos.Chandras@imgtec.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/kernel/mcount_64.S

index 35a793f..6dc134b 100644 (file)
@@ -194,6 +194,7 @@ ENTRY(function_hook)
        cmpq $ftrace_stub, ftrace_trace_function
        jnz trace
 
+fgraph_trace:
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        cmpq $ftrace_stub, ftrace_graph_return
        jnz ftrace_graph_caller
@@ -220,7 +221,7 @@ trace:
 
        MCOUNT_RESTORE_FRAME
 
-       jmp ftrace_stub
+       jmp fgraph_trace
 END(function_hook)
 #endif /* CONFIG_DYNAMIC_FTRACE */
 #endif /* CONFIG_FUNCTION_TRACER */