Commit 4d1298e2 authored by Oleg Nesterov's avatar Oleg Nesterov

uprobes/tracing: Make register_uprobe_event() paths uretprobe-friendly

Change uprobe_event_define_fields(), and __set_print_fmt() to check
is_ret_probe() and use the appropriate format/fields.
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Tested-by: default avatarAnton Arapov <anton@redhat.com>
parent 393a736c
...@@ -628,8 +628,14 @@ static int uprobe_event_define_fields(struct ftrace_event_call *event_call) ...@@ -628,8 +628,14 @@ static int uprobe_event_define_fields(struct ftrace_event_call *event_call)
struct uprobe_trace_entry_head field; struct uprobe_trace_entry_head field;
struct trace_uprobe *tu = event_call->data; struct trace_uprobe *tu = event_call->data;
if (is_ret_probe(tu)) {
DEFINE_FIELD(unsigned long, vaddr[0], FIELD_STRING_FUNC, 0);
DEFINE_FIELD(unsigned long, vaddr[1], FIELD_STRING_RETIP, 0);
size = SIZEOF_TRACE_ENTRY(true);
} else {
DEFINE_FIELD(unsigned long, vaddr[0], FIELD_STRING_IP, 0); DEFINE_FIELD(unsigned long, vaddr[0], FIELD_STRING_IP, 0);
size = SIZEOF_TRACE_ENTRY(false); size = SIZEOF_TRACE_ENTRY(false);
}
/* Set argument names as fields */ /* Set argument names as fields */
for (i = 0; i < tu->nr_args; i++) { for (i = 0; i < tu->nr_args; i++) {
ret = trace_define_field(event_call, tu->args[i].type->fmttype, ret = trace_define_field(event_call, tu->args[i].type->fmttype,
...@@ -652,8 +658,13 @@ static int __set_print_fmt(struct trace_uprobe *tu, char *buf, int len) ...@@ -652,8 +658,13 @@ static int __set_print_fmt(struct trace_uprobe *tu, char *buf, int len)
int i; int i;
int pos = 0; int pos = 0;
if (is_ret_probe(tu)) {
fmt = "(%lx <- %lx)";
arg = "REC->" FIELD_STRING_FUNC ", REC->" FIELD_STRING_RETIP;
} else {
fmt = "(%lx)"; fmt = "(%lx)";
arg = "REC->" FIELD_STRING_IP; arg = "REC->" FIELD_STRING_IP;
}
/* When len=0, we just calculate the needed length */ /* When len=0, we just calculate the needed length */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment