arm64: Fix static use of function graph
authorJulien Thierry <[email protected]>
Fri, 3 Nov 2017 11:44:16 +0000 (11:44 +0000)
committerWill Deacon <[email protected]>
Fri, 3 Nov 2017 12:05:23 +0000 (12:05 +0000)
Function graph does not work currently when CONFIG_DYNAMIC_TRACE is not
set. This is because ftrace_function_trace is not always set to ftrace_stub
when function_graph is in use.

Do not skip checking of graph tracer functions when ftrace_function_trace
is set.

Signed-off-by: Julien Thierry <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Mark Rutland <[email protected]>
Acked-by: Steven Rostedt (VMware) <[email protected]>
Reviewed-by: AKASHI Takahiro <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
arch/arm64/kernel/entry-ftrace.S

index e1be42e11ff5bc79435d540bc9846f2efea58b45..1175f5827ae17ffabc9f071e46b942c62b530a1f 100644 (file)
@@ -108,13 +108,8 @@ ENTRY(_mcount)
        mcount_get_lr   x1              //       function's lr (= parent's pc)
        blr     x2                      //   (*ftrace_trace_function)(pc, lr);
 
-#ifndef CONFIG_FUNCTION_GRAPH_TRACER
-skip_ftrace_call:                      //   return;
-       mcount_exit                     // }
-#else
-       mcount_exit                     //   return;
-                                       // }
-skip_ftrace_call:
+skip_ftrace_call:                      // }
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
        ldr_l   x2, ftrace_graph_return
        cmp     x0, x2                  //   if ((ftrace_graph_return
        b.ne    ftrace_graph_caller     //        != ftrace_stub)
@@ -123,9 +118,8 @@ skip_ftrace_call:
        adr_l   x0, ftrace_graph_entry_stub //     != ftrace_graph_entry_stub))
        cmp     x0, x2
        b.ne    ftrace_graph_caller     //     ftrace_graph_caller();
-
-       mcount_exit
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
+       mcount_exit
 ENDPROC(_mcount)
 
 #else /* CONFIG_DYNAMIC_FTRACE */