diff options
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/ftrace.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index cd7f76d1eb86..98ae4ed965db 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -244,7 +244,11 @@ static void control_ops_free(struct ftrace_ops *ops) | |||
| 244 | 244 | ||
| 245 | static void update_global_ops(void) | 245 | static void update_global_ops(void) |
| 246 | { | 246 | { |
| 247 | ftrace_func_t func; | 247 | ftrace_func_t func = ftrace_global_list_func; |
| 248 | void *private = NULL; | ||
| 249 | |||
| 250 | /* The list has its own recursion protection. */ | ||
| 251 | global_ops.flags |= FTRACE_OPS_FL_RECURSION_SAFE; | ||
| 248 | 252 | ||
| 249 | /* | 253 | /* |
| 250 | * If there's only one function registered, then call that | 254 | * If there's only one function registered, then call that |
| @@ -254,23 +258,17 @@ static void update_global_ops(void) | |||
| 254 | if (ftrace_global_list == &ftrace_list_end || | 258 | if (ftrace_global_list == &ftrace_list_end || |
| 255 | ftrace_global_list->next == &ftrace_list_end) { | 259 | ftrace_global_list->next == &ftrace_list_end) { |
| 256 | func = ftrace_global_list->func; | 260 | func = ftrace_global_list->func; |
| 261 | private = ftrace_global_list->private; | ||
| 257 | /* | 262 | /* |
| 258 | * As we are calling the function directly. | 263 | * As we are calling the function directly. |
| 259 | * If it does not have recursion protection, | 264 | * If it does not have recursion protection, |
| 260 | * the function_trace_op needs to be updated | 265 | * the function_trace_op needs to be updated |
| 261 | * accordingly. | 266 | * accordingly. |
| 262 | */ | 267 | */ |
| 263 | if (ftrace_global_list->flags & FTRACE_OPS_FL_RECURSION_SAFE) | 268 | if (!(ftrace_global_list->flags & FTRACE_OPS_FL_RECURSION_SAFE)) |
| 264 | global_ops.flags |= FTRACE_OPS_FL_RECURSION_SAFE; | ||
| 265 | else | ||
| 266 | global_ops.flags &= ~FTRACE_OPS_FL_RECURSION_SAFE; | 269 | global_ops.flags &= ~FTRACE_OPS_FL_RECURSION_SAFE; |
| 267 | } else { | ||
| 268 | func = ftrace_global_list_func; | ||
| 269 | /* The list has its own recursion protection. */ | ||
| 270 | global_ops.flags |= FTRACE_OPS_FL_RECURSION_SAFE; | ||
| 271 | } | 270 | } |
| 272 | 271 | ||
| 273 | |||
| 274 | /* If we filter on pids, update to use the pid function */ | 272 | /* If we filter on pids, update to use the pid function */ |
| 275 | if (!list_empty(&ftrace_pids)) { | 273 | if (!list_empty(&ftrace_pids)) { |
| 276 | set_ftrace_pid_function(func); | 274 | set_ftrace_pid_function(func); |
| @@ -278,6 +276,7 @@ static void update_global_ops(void) | |||
| 278 | } | 276 | } |
| 279 | 277 | ||
| 280 | global_ops.func = func; | 278 | global_ops.func = func; |
| 279 | global_ops.private = private; | ||
| 281 | } | 280 | } |
| 282 | 281 | ||
| 283 | static void ftrace_sync(struct work_struct *work) | 282 | static void ftrace_sync(struct work_struct *work) |
