diff options
-rw-r--r-- | kernel/trace/ftrace.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 4c61f28a08e0..762806026561 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2949,13 +2949,6 @@ ftrace_enabled_open(struct inode *inode, struct file *file) | |||
2949 | return iter ? 0 : -ENOMEM; | 2949 | return iter ? 0 : -ENOMEM; |
2950 | } | 2950 | } |
2951 | 2951 | ||
2952 | static void ftrace_filter_reset(struct ftrace_hash *hash) | ||
2953 | { | ||
2954 | mutex_lock(&ftrace_lock); | ||
2955 | ftrace_hash_clear(hash); | ||
2956 | mutex_unlock(&ftrace_lock); | ||
2957 | } | ||
2958 | |||
2959 | /** | 2952 | /** |
2960 | * ftrace_regex_open - initialize function tracer filter files | 2953 | * ftrace_regex_open - initialize function tracer filter files |
2961 | * @ops: The ftrace_ops that hold the hash filters | 2954 | * @ops: The ftrace_ops that hold the hash filters |
@@ -3720,14 +3713,16 @@ ftrace_set_hash(struct ftrace_ops *ops, unsigned char *buf, int len, | |||
3720 | else | 3713 | else |
3721 | orig_hash = &ops->notrace_hash; | 3714 | orig_hash = &ops->notrace_hash; |
3722 | 3715 | ||
3723 | hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash); | 3716 | if (reset) |
3717 | hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS); | ||
3718 | else | ||
3719 | hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash); | ||
3720 | |||
3724 | if (!hash) { | 3721 | if (!hash) { |
3725 | ret = -ENOMEM; | 3722 | ret = -ENOMEM; |
3726 | goto out_regex_unlock; | 3723 | goto out_regex_unlock; |
3727 | } | 3724 | } |
3728 | 3725 | ||
3729 | if (reset) | ||
3730 | ftrace_filter_reset(hash); | ||
3731 | if (buf && !ftrace_match_records(hash, buf, len)) { | 3726 | if (buf && !ftrace_match_records(hash, buf, len)) { |
3732 | ret = -EINVAL; | 3727 | ret = -EINVAL; |
3733 | goto out_regex_unlock; | 3728 | goto out_regex_unlock; |