aboutsummaryrefslogtreecommitdiff
path: root/kernel/trace/trace_event_perf.c
diff options
context:
space:
mode:
authorLinus Walleij2019-11-13 23:10:52 +0100
committerLinus Walleij2019-11-13 23:10:52 +0100
commit1566a6a30bf4d85849bab7e389392d6d3de1530e (patch)
treebbc979f430cb07d41f7b35524027e25e7a4b9fe6 /kernel/trace/trace_event_perf.c
parent3af50e548019f6ee26d0ed4340f4ab980f884696 (diff)
parentd6d5df1db6e9d7f8f76d2911707f7d5877251b02 (diff)
Merge tag 'v5.4-rc5' into devel
Linux 5.4-rc5
Diffstat (limited to 'kernel/trace/trace_event_perf.c')
-rw-r--r--kernel/trace/trace_event_perf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 0892e38ed6fb..a9dfa04ffa44 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -272,9 +272,11 @@ int perf_kprobe_init(struct perf_event *p_event, bool is_retprobe)
goto out;
}
+ mutex_lock(&event_mutex);
ret = perf_trace_event_init(tp_event, p_event);
if (ret)
destroy_local_trace_kprobe(tp_event);
+ mutex_unlock(&event_mutex);
out:
kfree(func);
return ret;
@@ -282,8 +284,10 @@ out:
void perf_kprobe_destroy(struct perf_event *p_event)
{
+ mutex_lock(&event_mutex);
perf_trace_event_close(p_event);
perf_trace_event_unreg(p_event);
+ mutex_unlock(&event_mutex);
destroy_local_trace_kprobe(p_event->tp_event);
}