diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
| -rw-r--r-- | kernel/trace/ftrace.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 5bd70e8b09b0..0e48ff4cefa5 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -1994,6 +1994,7 @@ int __weak ftrace_arch_code_modify_post_process(void) | |||
| 1994 | void ftrace_modify_all_code(int command) | 1994 | void ftrace_modify_all_code(int command) |
| 1995 | { | 1995 | { |
| 1996 | int update = command & FTRACE_UPDATE_TRACE_FUNC; | 1996 | int update = command & FTRACE_UPDATE_TRACE_FUNC; |
| 1997 | int err = 0; | ||
| 1997 | 1998 | ||
| 1998 | /* | 1999 | /* |
| 1999 | * If the ftrace_caller calls a ftrace_ops func directly, | 2000 | * If the ftrace_caller calls a ftrace_ops func directly, |
| @@ -2005,8 +2006,11 @@ void ftrace_modify_all_code(int command) | |||
| 2005 | * to make sure the ops are having the right functions | 2006 | * to make sure the ops are having the right functions |
| 2006 | * traced. | 2007 | * traced. |
| 2007 | */ | 2008 | */ |
| 2008 | if (update) | 2009 | if (update) { |
| 2009 | ftrace_update_ftrace_func(ftrace_ops_list_func); | 2010 | err = ftrace_update_ftrace_func(ftrace_ops_list_func); |
| 2011 | if (FTRACE_WARN_ON(err)) | ||
| 2012 | return; | ||
| 2013 | } | ||
| 2010 | 2014 | ||
| 2011 | if (command & FTRACE_UPDATE_CALLS) | 2015 | if (command & FTRACE_UPDATE_CALLS) |
| 2012 | ftrace_replace_code(1); | 2016 | ftrace_replace_code(1); |
| @@ -2019,13 +2023,16 @@ void ftrace_modify_all_code(int command) | |||
| 2019 | /* If irqs are disabled, we are in stop machine */ | 2023 | /* If irqs are disabled, we are in stop machine */ |
| 2020 | if (!irqs_disabled()) | 2024 | if (!irqs_disabled()) |
| 2021 | smp_call_function(ftrace_sync_ipi, NULL, 1); | 2025 | smp_call_function(ftrace_sync_ipi, NULL, 1); |
| 2022 | ftrace_update_ftrace_func(ftrace_trace_function); | 2026 | err = ftrace_update_ftrace_func(ftrace_trace_function); |
| 2027 | if (FTRACE_WARN_ON(err)) | ||
| 2028 | return; | ||
| 2023 | } | 2029 | } |
| 2024 | 2030 | ||
| 2025 | if (command & FTRACE_START_FUNC_RET) | 2031 | if (command & FTRACE_START_FUNC_RET) |
| 2026 | ftrace_enable_ftrace_graph_caller(); | 2032 | err = ftrace_enable_ftrace_graph_caller(); |
| 2027 | else if (command & FTRACE_STOP_FUNC_RET) | 2033 | else if (command & FTRACE_STOP_FUNC_RET) |
| 2028 | ftrace_disable_ftrace_graph_caller(); | 2034 | err = ftrace_disable_ftrace_graph_caller(); |
| 2035 | FTRACE_WARN_ON(err); | ||
| 2029 | } | 2036 | } |
| 2030 | 2037 | ||
| 2031 | static int __ftrace_modify_code(void *data) | 2038 | static int __ftrace_modify_code(void *data) |
