aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c14
-rw-r--r--kernel/trace/trace.c6
-rw-r--r--kernel/trace/trace.h2
-rw-r--r--kernel/trace/trace_events.c3
-rw-r--r--kernel/trace/trace_functions.c6
5 files changed, 17 insertions, 14 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 5c8d8eea9e7c..cbae7fb1be15 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4102,7 +4102,7 @@ register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
4102 return count; 4102 return count;
4103} 4103}
4104 4104
4105void 4105int
4106unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops) 4106unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
4107{ 4107{
4108 struct ftrace_ops_hash old_hash_ops; 4108 struct ftrace_ops_hash old_hash_ops;
@@ -4131,7 +4131,7 @@ unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
4131 4131
4132 /* we do not support '!' for function probes */ 4132 /* we do not support '!' for function probes */
4133 if (WARN_ON(not)) 4133 if (WARN_ON(not))
4134 return; 4134 return -EINVAL;
4135 } 4135 }
4136 4136
4137 mutex_lock(&trace_probe_ops.func_hash->regex_lock); 4137 mutex_lock(&trace_probe_ops.func_hash->regex_lock);
@@ -4140,9 +4140,9 @@ unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
4140 /* Probes only have filters */ 4140 /* Probes only have filters */
4141 old_hash_ops.notrace_hash = NULL; 4141 old_hash_ops.notrace_hash = NULL;
4142 4142
4143 ret = -ENOMEM;
4143 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash); 4144 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash);
4144 if (!hash) 4145 if (!hash)
4145 /* Hmm, should report this somehow */
4146 goto out_unlock; 4146 goto out_unlock;
4147 4147
4148 INIT_LIST_HEAD(&free_list); 4148 INIT_LIST_HEAD(&free_list);
@@ -4173,6 +4173,13 @@ unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
4173 list_add(&entry->free_list, &free_list); 4173 list_add(&entry->free_list, &free_list);
4174 } 4174 }
4175 } 4175 }
4176
4177 /* Nothing found? */
4178 if (list_empty(&free_list)) {
4179 ret = -EINVAL;
4180 goto out_unlock;
4181 }
4182
4176 mutex_lock(&ftrace_lock); 4183 mutex_lock(&ftrace_lock);
4177 disabled = __disable_ftrace_function_probe(); 4184 disabled = __disable_ftrace_function_probe();
4178 /* 4185 /*
@@ -4198,6 +4205,7 @@ unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
4198 out_unlock: 4205 out_unlock:
4199 mutex_unlock(&trace_probe_ops.func_hash->regex_lock); 4206 mutex_unlock(&trace_probe_ops.func_hash->regex_lock);
4200 free_ftrace_hash(hash); 4207 free_ftrace_hash(hash);
4208 return ret;
4201} 4209}
4202 4210
4203static LIST_HEAD(ftrace_commands); 4211static LIST_HEAD(ftrace_commands);
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 7a4d578d8887..64a4418a5106 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6829,10 +6829,8 @@ ftrace_trace_snapshot_callback(struct ftrace_hash *hash,
6829 6829
6830 ops = param ? &snapshot_count_probe_ops : &snapshot_probe_ops; 6830 ops = param ? &snapshot_count_probe_ops : &snapshot_probe_ops;
6831 6831
6832 if (glob[0] == '!') { 6832 if (glob[0] == '!')
6833 unregister_ftrace_function_probe_func(glob+1, ops); 6833 return unregister_ftrace_function_probe_func(glob+1, ops);
6834 return 0;
6835 }
6836 6834
6837 if (!param) 6835 if (!param)
6838 goto out_reg; 6836 goto out_reg;
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 86aa5a2222ba..31d80bff9ee6 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -963,7 +963,7 @@ void free_ftrace_func_mapper(struct ftrace_func_mapper *mapper,
963extern int 963extern int
964register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, 964register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
965 void *data); 965 void *data);
966extern void 966extern int
967unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops); 967unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
968 968
969int register_ftrace_command(struct ftrace_func_command *cmd); 969int register_ftrace_command(struct ftrace_func_command *cmd);
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 37902107c44f..9e07a5b3869b 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -2652,8 +2652,7 @@ event_enable_func(struct ftrace_hash *hash,
2652 ops = param ? &event_disable_count_probe_ops : &event_disable_probe_ops; 2652 ops = param ? &event_disable_count_probe_ops : &event_disable_probe_ops;
2653 2653
2654 if (glob[0] == '!') { 2654 if (glob[0] == '!') {
2655 unregister_ftrace_function_probe_func(glob+1, ops); 2655 ret = unregister_ftrace_function_probe_func(glob+1, ops);
2656 ret = 0;
2657 goto out; 2656 goto out;
2658 } 2657 }
2659 2658
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 56d0fe1e4ea1..dcb4d37ed4bd 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -586,10 +586,8 @@ ftrace_trace_probe_callback(struct ftrace_probe_ops *ops,
586 if (!enable) 586 if (!enable)
587 return -EINVAL; 587 return -EINVAL;
588 588
589 if (glob[0] == '!') { 589 if (glob[0] == '!')
590 unregister_ftrace_function_probe_func(glob+1, ops); 590 return unregister_ftrace_function_probe_func(glob+1, ops);
591 return 0;
592 }
593 591
594 if (!param) 592 if (!param)
595 goto out_reg; 593 goto out_reg;