|
@@ -400,11 +400,10 @@ static struct trace_kprobe *find_trace_kprobe(const char *event,
|
|
static int
|
|
static int
|
|
enable_trace_kprobe(struct trace_kprobe *tk, struct trace_event_file *file)
|
|
enable_trace_kprobe(struct trace_kprobe *tk, struct trace_event_file *file)
|
|
{
|
|
{
|
|
|
|
+ struct event_file_link *link;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
if (file) {
|
|
if (file) {
|
|
- struct event_file_link *link;
|
|
|
|
-
|
|
|
|
link = kmalloc(sizeof(*link), GFP_KERNEL);
|
|
link = kmalloc(sizeof(*link), GFP_KERNEL);
|
|
if (!link) {
|
|
if (!link) {
|
|
ret = -ENOMEM;
|
|
ret = -ENOMEM;
|
|
@@ -424,6 +423,16 @@ enable_trace_kprobe(struct trace_kprobe *tk, struct trace_event_file *file)
|
|
else
|
|
else
|
|
ret = enable_kprobe(&tk->rp.kp);
|
|
ret = enable_kprobe(&tk->rp.kp);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (ret) {
|
|
|
|
+ if (file) {
|
|
|
|
+ list_del_rcu(&link->list);
|
|
|
|
+ kfree(link);
|
|
|
|
+ tk->tp.flags &= ~TP_FLAG_TRACE;
|
|
|
|
+ } else {
|
|
|
|
+ tk->tp.flags &= ~TP_FLAG_PROFILE;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
out:
|
|
out:
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|