]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/trace/ftrace.c
Merge tag 'powerpc-4.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[karo-tx-linux.git] / kernel / trace / ftrace.c
index 39dca4e86a94f0867c29aaa29b47d881eefd02e8..9e5841dc14b5fa62e0c1470df704c3dc9b99f8ad 100644 (file)
@@ -4144,9 +4144,9 @@ unregister_ftrace_function_probe_func(char *glob, struct trace_array *tr,
        int i, ret = -ENODEV;
        int size;
 
-       if (glob && (strcmp(glob, "*") == 0 || !strlen(glob)))
+       if (!glob || !strlen(glob) || !strcmp(glob, "*"))
                func_g.search = NULL;
-       else if (glob) {
+       else {
                int not;
 
                func_g.type = filter_parse_regex(glob, strlen(glob),
@@ -4256,6 +4256,14 @@ unregister_ftrace_function_probe_func(char *glob, struct trace_array *tr,
        return ret;
 }
 
+void clear_ftrace_function_probes(struct trace_array *tr)
+{
+       struct ftrace_func_probe *probe, *n;
+
+       list_for_each_entry_safe(probe, n, &tr->func_probes, list)
+               unregister_ftrace_function_probe_func(NULL, tr, probe->probe_ops);
+}
+
 static LIST_HEAD(ftrace_commands);
 static DEFINE_MUTEX(ftrace_cmd_mutex);
 
@@ -5055,7 +5063,7 @@ ftrace_graph_release(struct inode *inode, struct file *file)
        }
 
  out:
-       kfree(fgd->new_hash);
+       free_ftrace_hash(fgd->new_hash);
        kfree(fgd);
 
        return ret;