diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/trace/ftrace.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 929a733d302e..2b35d0ba578d 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -4008,8 +4008,32 @@ ftrace_match_addr(struct ftrace_hash *hash, unsigned long ip, int remove) | |||
| 4008 | static void ftrace_ops_update_code(struct ftrace_ops *ops, | 4008 | static void ftrace_ops_update_code(struct ftrace_ops *ops, |
| 4009 | struct ftrace_hash *old_hash) | 4009 | struct ftrace_hash *old_hash) |
| 4010 | { | 4010 | { |
| 4011 | if (ops->flags & FTRACE_OPS_FL_ENABLED && ftrace_enabled) | 4011 | struct ftrace_ops *op; |
| 4012 | |||
| 4013 | if (!ftrace_enabled) | ||
| 4014 | return; | ||
| 4015 | |||
| 4016 | if (ops->flags & FTRACE_OPS_FL_ENABLED) { | ||
| 4012 | ftrace_run_modify_code(ops, FTRACE_UPDATE_CALLS, old_hash); | 4017 | ftrace_run_modify_code(ops, FTRACE_UPDATE_CALLS, old_hash); |
| 4018 | return; | ||
| 4019 | } | ||
| 4020 | |||
| 4021 | /* | ||
| 4022 | * If this is the shared global_ops filter, then we need to | ||
| 4023 | * check if there is another ops that shares it, is enabled. | ||
| 4024 | * If so, we still need to run the modify code. | ||
| 4025 | */ | ||
| 4026 | if (ops->func_hash != &global_ops.local_hash) | ||
| 4027 | return; | ||
| 4028 | |||
| 4029 | do_for_each_ftrace_op(op, ftrace_ops_list) { | ||
| 4030 | if (op->func_hash == &global_ops.local_hash && | ||
| 4031 | op->flags & FTRACE_OPS_FL_ENABLED) { | ||
| 4032 | ftrace_run_modify_code(op, FTRACE_UPDATE_CALLS, old_hash); | ||
| 4033 | /* Only need to do this once */ | ||
| 4034 | return; | ||
| 4035 | } | ||
| 4036 | } while_for_each_ftrace_op(op); | ||
| 4013 | } | 4037 | } |
| 4014 | 4038 | ||
| 4015 | static int | 4039 | static int |
