summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_probe.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2019-05-31 17:17:57 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-07-16 21:14:47 +0200
commite3dc9f898ef9c6a1a96378517573ee2d04d0abcc (patch)
tree262ce067fc6f2c093026ba9286fa6bc7f12e1cd3 /kernel/trace/trace_probe.c
parenttracing/probe: Add probe event name and group name accesses APIs (diff)
downloadlinux-e3dc9f898ef9c6a1a96378517573ee2d04d0abcc.tar.xz
linux-e3dc9f898ef9c6a1a96378517573ee2d04d0abcc.zip
tracing/probe: Add trace_event_call accesses APIs
Add trace_event_call access APIs for trace_probe. Instead of accessing trace_probe.call directly, use those accesses by trace_probe_event_call() method. This hides the relationship of trace_event_call and trace_probe from trace_kprobe and trace_uprobe. Link: http://lkml.kernel.org/r/155931587711.28323.8335129014686133120.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.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 323a11ad1dad..dbef0d135075 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -844,6 +844,7 @@ static int __set_print_fmt(struct trace_probe *tp, char *buf, int len,
int traceprobe_set_print_fmt(struct trace_probe *tp, bool is_return)
{
+ struct trace_event_call *call = trace_probe_event_call(tp);
int len;
char *print_fmt;
@@ -855,7 +856,7 @@ int traceprobe_set_print_fmt(struct trace_probe *tp, bool is_return)
/* Second: actually write the @print_fmt */
__set_print_fmt(tp, print_fmt, len + 1, is_return);
- tp->call.print_fmt = print_fmt;
+ call->print_fmt = print_fmt;
return 0;
}
@@ -888,31 +889,34 @@ int traceprobe_define_arg_fields(struct trace_event_call *event_call,
void trace_probe_cleanup(struct trace_probe *tp)
{
+ struct trace_event_call *call = trace_probe_event_call(tp);
int i;
for (i = 0; i < tp->nr_args; i++)
traceprobe_free_probe_arg(&tp->args[i]);
- kfree(tp->call.class->system);
- kfree(tp->call.name);
- kfree(tp->call.print_fmt);
+ kfree(call->class->system);
+ kfree(call->name);
+ kfree(call->print_fmt);
}
int trace_probe_init(struct trace_probe *tp, const char *event,
const char *group)
{
+ struct trace_event_call *call = trace_probe_event_call(tp);
+
if (!event || !group)
return -EINVAL;
- tp->call.class = &tp->class;
- tp->call.name = kstrdup(event, GFP_KERNEL);
- if (!tp->call.name)
+ call->class = &tp->class;
+ call->name = kstrdup(event, GFP_KERNEL);
+ if (!call->name)
return -ENOMEM;
tp->class.system = kstrdup(group, GFP_KERNEL);
if (!tp->class.system) {
- kfree(tp->call.name);
- tp->call.name = NULL;
+ kfree(call->name);
+ call->name = NULL;
return -ENOMEM;
}
INIT_LIST_HEAD(&tp->files);
@@ -923,7 +927,7 @@ int trace_probe_init(struct trace_probe *tp, const char *event,
int trace_probe_register_event_call(struct trace_probe *tp)
{
- struct trace_event_call *call = &tp->call;
+ struct trace_event_call *call = trace_probe_event_call(tp);
int ret;
ret = register_trace_event(&call->event);