diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-03-30 14:23:15 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2013-04-13 09:32:03 -0400 |
commit | 4d1298e2124767b4e263498485618b2e91aee5f0 (patch) | |
tree | ec9888fa9d27d0e8be7a94c7d09623f09b3a770e /kernel/trace/trace_uprobe.c | |
parent | 393a736c280d555d9301fc5516d4d401544eb9db (diff) |
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: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Tested-by: Anton Arapov <anton@redhat.com>
Diffstat (limited to 'kernel/trace/trace_uprobe.c')
-rw-r--r-- | kernel/trace/trace_uprobe.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 0ed99a27d122..457576215b3a 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c | |||
@@ -628,8 +628,14 @@ static int uprobe_event_define_fields(struct ftrace_event_call *event_call) | |||
628 | struct uprobe_trace_entry_head field; | 628 | struct uprobe_trace_entry_head field; |
629 | struct trace_uprobe *tu = event_call->data; | 629 | struct trace_uprobe *tu = event_call->data; |
630 | 630 | ||
631 | DEFINE_FIELD(unsigned long, vaddr[0], FIELD_STRING_IP, 0); | 631 | if (is_ret_probe(tu)) { |
632 | size = SIZEOF_TRACE_ENTRY(false); | 632 | DEFINE_FIELD(unsigned long, vaddr[0], FIELD_STRING_FUNC, 0); |
633 | DEFINE_FIELD(unsigned long, vaddr[1], FIELD_STRING_RETIP, 0); | ||
634 | size = SIZEOF_TRACE_ENTRY(true); | ||
635 | } else { | ||
636 | DEFINE_FIELD(unsigned long, vaddr[0], FIELD_STRING_IP, 0); | ||
637 | size = SIZEOF_TRACE_ENTRY(false); | ||
638 | } | ||
633 | /* Set argument names as fields */ | 639 | /* Set argument names as fields */ |
634 | for (i = 0; i < tu->nr_args; i++) { | 640 | for (i = 0; i < tu->nr_args; i++) { |
635 | ret = trace_define_field(event_call, tu->args[i].type->fmttype, | 641 | 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 | int i; | 658 | int i; |
653 | int pos = 0; | 659 | int pos = 0; |
654 | 660 | ||
655 | fmt = "(%lx)"; | 661 | if (is_ret_probe(tu)) { |
656 | arg = "REC->" FIELD_STRING_IP; | 662 | fmt = "(%lx <- %lx)"; |
663 | arg = "REC->" FIELD_STRING_FUNC ", REC->" FIELD_STRING_RETIP; | ||
664 | } else { | ||
665 | fmt = "(%lx)"; | ||
666 | arg = "REC->" FIELD_STRING_IP; | ||
667 | } | ||
657 | 668 | ||
658 | /* When len=0, we just calculate the needed length */ | 669 | /* When len=0, we just calculate the needed length */ |
659 | 670 | ||