aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ftrace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-04-27 09:13:18 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-05-16 20:00:27 -0400
commite4f5d5440bb860a3e8942ca8f7277a7f31798965 (patch)
tree324091109c5bbaae5a06e52a77369cf2731ebb54 /arch/x86/kernel/ftrace.c
parent8ed3e2cfe40ffe43630fd8efa34fc97c95b4c298 (diff)
ftrace/x86: Have x86 ftrace use the ftrace_modify_all_code()
To remove duplicate code, have the ftrace arch_ftrace_update_code() use the generic ftrace_modify_all_code(). This requires that the default ftrace_replace_code() becomes a weak function so that an arch may override it. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch/x86/kernel/ftrace.c')
-rw-r--r--arch/x86/kernel/ftrace.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 4243e8bbdcb1..32ff36596ab1 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -435,7 +435,7 @@ static void run_sync(void)
435 local_irq_disable(); 435 local_irq_disable();
436} 436}
437 437
438static void ftrace_replace_code(int enable) 438void ftrace_replace_code(int enable)
439{ 439{
440 struct ftrace_rec_iter *iter; 440 struct ftrace_rec_iter *iter;
441 struct dyn_ftrace *rec; 441 struct dyn_ftrace *rec;
@@ -493,18 +493,7 @@ void arch_ftrace_update_code(int command)
493{ 493{
494 modifying_ftrace_code++; 494 modifying_ftrace_code++;
495 495
496 if (command & FTRACE_UPDATE_CALLS) 496 ftrace_modify_all_code(command);
497 ftrace_replace_code(1);
498 else if (command & FTRACE_DISABLE_CALLS)
499 ftrace_replace_code(0);
500
501 if (command & FTRACE_UPDATE_TRACE_FUNC)
502 ftrace_update_ftrace_func(ftrace_trace_function);
503
504 if (command & FTRACE_START_FUNC_RET)
505 ftrace_enable_ftrace_graph_caller();
506 else if (command & FTRACE_STOP_FUNC_RET)
507 ftrace_disable_ftrace_graph_caller();
508 497
509 modifying_ftrace_code--; 498 modifying_ftrace_code--;
510} 499}