diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/ftrace.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8ce9eefc5bb4..92d3334de0c3 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -3384,6 +3384,12 @@ ftrace_match_addr(struct ftrace_hash *hash, unsigned long ip, int remove) | |||
3384 | return add_hash_entry(hash, ip); | 3384 | return add_hash_entry(hash, ip); |
3385 | } | 3385 | } |
3386 | 3386 | ||
3387 | static void ftrace_ops_update_code(struct ftrace_ops *ops) | ||
3388 | { | ||
3389 | if (ops->flags & FTRACE_OPS_FL_ENABLED && ftrace_enabled) | ||
3390 | ftrace_run_update_code(FTRACE_UPDATE_CALLS); | ||
3391 | } | ||
3392 | |||
3387 | static int | 3393 | static int |
3388 | ftrace_set_hash(struct ftrace_ops *ops, unsigned char *buf, int len, | 3394 | ftrace_set_hash(struct ftrace_ops *ops, unsigned char *buf, int len, |
3389 | unsigned long ip, int remove, int reset, int enable) | 3395 | unsigned long ip, int remove, int reset, int enable) |
@@ -3426,9 +3432,8 @@ ftrace_set_hash(struct ftrace_ops *ops, unsigned char *buf, int len, | |||
3426 | 3432 | ||
3427 | mutex_lock(&ftrace_lock); | 3433 | mutex_lock(&ftrace_lock); |
3428 | ret = ftrace_hash_move(ops, enable, orig_hash, hash); | 3434 | ret = ftrace_hash_move(ops, enable, orig_hash, hash); |
3429 | if (!ret && ops->flags & FTRACE_OPS_FL_ENABLED | 3435 | if (!ret) |
3430 | && ftrace_enabled) | 3436 | ftrace_ops_update_code(ops); |
3431 | ftrace_run_update_code(FTRACE_UPDATE_CALLS); | ||
3432 | 3437 | ||
3433 | mutex_unlock(&ftrace_lock); | 3438 | mutex_unlock(&ftrace_lock); |
3434 | 3439 | ||
@@ -3655,9 +3660,8 @@ int ftrace_regex_release(struct inode *inode, struct file *file) | |||
3655 | mutex_lock(&ftrace_lock); | 3660 | mutex_lock(&ftrace_lock); |
3656 | ret = ftrace_hash_move(iter->ops, filter_hash, | 3661 | ret = ftrace_hash_move(iter->ops, filter_hash, |
3657 | orig_hash, iter->hash); | 3662 | orig_hash, iter->hash); |
3658 | if (!ret && (iter->ops->flags & FTRACE_OPS_FL_ENABLED) | 3663 | if (!ret) |
3659 | && ftrace_enabled) | 3664 | ftrace_ops_update_code(iter->ops); |
3660 | ftrace_run_update_code(FTRACE_UPDATE_CALLS); | ||
3661 | 3665 | ||
3662 | mutex_unlock(&ftrace_lock); | 3666 | mutex_unlock(&ftrace_lock); |
3663 | } | 3667 | } |