diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2019-05-31 18:17:16 +0300 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-07-16 22:14:47 +0300 |
commit | 46e5376d404d14cb321f5d4e446fe3fb6d8a93ab (patch) | |
tree | 7b91fab2dadd1a9ced58d5e29840dbcef2ac223e /kernel/trace/trace_probe.c | |
parent | 455b289973f7df350ea179c7eb8bfed0c766ec40 (diff) | |
download | linux-46e5376d404d14cb321f5d4e446fe3fb6d8a93ab.tar.xz |
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_probe.c')
-rw-r--r-- | kernel/trace/trace_probe.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index fe4ee2e73d92..509a26024b4f 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -920,3 +920,19 @@ int trace_probe_init(struct trace_probe *tp, const char *event, return 0; } + +int trace_probe_register_event_call(struct trace_probe *tp) +{ + struct trace_event_call *call = &tp->call; + int ret; + + ret = register_trace_event(&call->event); + if (!ret) + return -ENODEV; + + ret = trace_add_event_call(call); + if (ret) + unregister_trace_event(&call->event); + + return ret; +} |