aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-04-26 14:59:43 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-05-16 20:00:26 -0400
commit8ed3e2cfe40ffe43630fd8efa34fc97c95b4c298 (patch)
tree7460935d25c77dc13ef887dc664fd7529886665e /kernel
parentf0cf973a224a3e3c1dec3395af3ba01cf14b1ff4 (diff)
ftrace: Make ftrace_modify_all_code() global for archs to use
Rename __ftrace_modify_code() to ftrace_modify_all_code() and make it global for all archs to use. This will remove the duplication of code, as archs that can modify code without stop_machine() can use it directly outside of the stop_machine() call. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index ef0826204840..3c345825cc23 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1811,22 +1811,27 @@ int __weak ftrace_arch_code_modify_post_process(void)
1811 return 0; 1811 return 0;
1812} 1812}
1813 1813
1814static int __ftrace_modify_code(void *data) 1814void ftrace_modify_all_code(int command)
1815{ 1815{
1816 int *command = data; 1816 if (command & FTRACE_UPDATE_CALLS)
1817
1818 if (*command & FTRACE_UPDATE_CALLS)
1819 ftrace_replace_code(1); 1817 ftrace_replace_code(1);
1820 else if (*command & FTRACE_DISABLE_CALLS) 1818 else if (command & FTRACE_DISABLE_CALLS)
1821 ftrace_replace_code(0); 1819 ftrace_replace_code(0);
1822 1820
1823 if (*command & FTRACE_UPDATE_TRACE_FUNC) 1821 if (command & FTRACE_UPDATE_TRACE_FUNC)
1824 ftrace_update_ftrace_func(ftrace_trace_function); 1822 ftrace_update_ftrace_func(ftrace_trace_function);
1825 1823
1826 if (*command & FTRACE_START_FUNC_RET) 1824 if (command & FTRACE_START_FUNC_RET)
1827 ftrace_enable_ftrace_graph_caller(); 1825 ftrace_enable_ftrace_graph_caller();
1828 else if (*command & FTRACE_STOP_FUNC_RET) 1826 else if (command & FTRACE_STOP_FUNC_RET)
1829 ftrace_disable_ftrace_graph_caller(); 1827 ftrace_disable_ftrace_graph_caller();
1828}
1829
1830static int __ftrace_modify_code(void *data)
1831{
1832 int *command = data;
1833
1834 ftrace_modify_all_code(*command);
1830 1835
1831 return 0; 1836 return 0;
1832} 1837}