diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2019-06-01 00:17:16 +0900 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-07-16 15:14:47 -0400 |
commit | 46e5376d404d14cb321f5d4e446fe3fb6d8a93ab (patch) | |
tree | 7b91fab2dadd1a9ced58d5e29840dbcef2ac223e /kernel/trace/trace_kprobe.c | |
parent | 455b289973f7df350ea179c7eb8bfed0c766ec40 (diff) | |
download | linux-46e5376d404d14cb321f5d4e446fe3fb6d8a93ab.tar.gz |
tracing/probe: Add trace_event_call register API for trace_probe
Since trace_event_call is a field of trace_probe, these
operations should be done in trace_probe.c. trace_kprobe
and trace_uprobe use new functions to register/unregister
trace_event_call.
Link: http://lkml.kernel.org/r/155931583643.28323.14828411185591538876.stgit@devnote2
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_kprobe.c')
-rw-r--r-- | kernel/trace/trace_kprobe.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index c43c2d419ded..7f802ee27266 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -1393,28 +1393,14 @@ static inline void init_trace_event_call(struct trace_kprobe *tk, static int register_kprobe_event(struct trace_kprobe *tk) { - struct trace_event_call *call = &tk->tp.call; - int ret = 0; - - init_trace_event_call(tk, call); - - ret = register_trace_event(&call->event); - if (!ret) - return -ENODEV; + init_trace_event_call(tk, &tk->tp.call); - ret = trace_add_event_call(call); - if (ret) { - pr_info("Failed to register kprobe event: %s\n", - trace_event_name(call)); - unregister_trace_event(&call->event); - } - return ret; + return trace_probe_register_event_call(&tk->tp); } static int unregister_kprobe_event(struct trace_kprobe *tk) { - /* tp->event is unregistered in trace_remove_event_call() */ - return trace_remove_event_call(&tk->tp.call); + return trace_probe_unregister_event_call(&tk->tp); } #ifdef CONFIG_PERF_EVENTS |