powerpc/ftrace: Use generic ftrace_modify_all_code()
authorTorsten Duwe <[email protected]>
Thu, 3 Mar 2016 04:26:57 +0000 (15:26 +1100)
committerMichael Ellerman <[email protected]>
Mon, 7 Mar 2016 03:53:54 +0000 (14:53 +1100)
Convert powerpc's arch_ftrace_update_code() from its own version to use
the generic default functionality (without stop_machine -- our
instructions are properly aligned and the replacements atomic).

With this we gain error checking and the much-needed function_trace_op
handling.

Reviewed-by: Balbir Singh <[email protected]>
Reviewed-by: Kamalesh Babulal <[email protected]>
Signed-off-by: Torsten Duwe <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
arch/powerpc/kernel/ftrace.c

index 4505cbfd0e13b21d6813338d85af58b52329bfdf..62899fbae70389da63a741caf3c90836f5278483 100644 (file)
@@ -449,20 +449,13 @@ void ftrace_replace_code(int enable)
        }
 }
 
+/*
+ * Use the default ftrace_modify_all_code, but without
+ * stop_machine().
+ */
 void arch_ftrace_update_code(int command)
 {
-       if (command & FTRACE_UPDATE_CALLS)
-               ftrace_replace_code(1);
-       else if (command & FTRACE_DISABLE_CALLS)
-               ftrace_replace_code(0);
-
-       if (command & FTRACE_UPDATE_TRACE_FUNC)
-               ftrace_update_ftrace_func(ftrace_trace_function);
-
-       if (command & FTRACE_START_FUNC_RET)
-               ftrace_enable_ftrace_graph_caller();
-       else if (command & FTRACE_STOP_FUNC_RET)
-               ftrace_disable_ftrace_graph_caller();
+       ftrace_modify_all_code(command);
 }
 
 int __init ftrace_dyn_arch_init(void)