return count;
}
-void
+int
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
{
struct ftrace_ops_hash old_hash_ops;
/* we do not support '!' for function probes */
if (WARN_ON(not))
- return;
+ return -EINVAL;
}
mutex_lock(&trace_probe_ops.func_hash->regex_lock);
/* Probes only have filters */
old_hash_ops.notrace_hash = NULL;
+ ret = -ENOMEM;
hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash);
if (!hash)
- /* Hmm, should report this somehow */
goto out_unlock;
INIT_LIST_HEAD(&free_list);
list_add(&entry->free_list, &free_list);
}
}
+
+ /* Nothing found? */
+ if (list_empty(&free_list)) {
+ ret = -EINVAL;
+ goto out_unlock;
+ }
+
mutex_lock(&ftrace_lock);
disabled = __disable_ftrace_function_probe();
/*
out_unlock:
mutex_unlock(&trace_probe_ops.func_hash->regex_lock);
free_ftrace_hash(hash);
+ return ret;
}
static LIST_HEAD(ftrace_commands);
ops = param ? &snapshot_count_probe_ops : &snapshot_probe_ops;
- if (glob[0] == '!') {
- unregister_ftrace_function_probe_func(glob+1, ops);
- return 0;
- }
+ if (glob[0] == '!')
+ return unregister_ftrace_function_probe_func(glob+1, ops);
if (!param)
goto out_reg;
extern int
register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
void *data);
-extern void
+extern int
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
int register_ftrace_command(struct ftrace_func_command *cmd);
ops = param ? &event_disable_count_probe_ops : &event_disable_probe_ops;
if (glob[0] == '!') {
- unregister_ftrace_function_probe_func(glob+1, ops);
- ret = 0;
+ ret = unregister_ftrace_function_probe_func(glob+1, ops);
goto out;
}