aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_uprobe.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-03-30 14:48:09 -0400
committerOleg Nesterov <oleg@redhat.com>2013-04-13 09:32:03 -0400
commit3ede82dd3e3deb23429f2bf44fb600f440eef84b (patch)
treeecf9313c1a1275b3b70ead7772f66a853e9f386f /kernel/trace/trace_uprobe.c
parent4d1298e2124767b4e263498485618b2e91aee5f0 (diff)
uprobes/tracing: Make seq_printf() code uretprobe-friendly
Change probes_seq_show() and print_uprobe_event() to check is_ret_probe() and print the correct data. 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.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 457576215b3a..8c9f4894bcc0 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -435,9 +435,10 @@ static void probes_seq_stop(struct seq_file *m, void *v)
435static int probes_seq_show(struct seq_file *m, void *v) 435static int probes_seq_show(struct seq_file *m, void *v)
436{ 436{
437 struct trace_uprobe *tu = v; 437 struct trace_uprobe *tu = v;
438 char c = is_ret_probe(tu) ? 'r' : 'p';
438 int i; 439 int i;
439 440
440 seq_printf(m, "p:%s/%s", tu->call.class->system, tu->call.name); 441 seq_printf(m, "%c:%s/%s", c, tu->call.class->system, tu->call.name);
441 seq_printf(m, " %s:0x%p", tu->filename, (void *)tu->offset); 442 seq_printf(m, " %s:0x%p", tu->filename, (void *)tu->offset);
442 443
443 for (i = 0; i < tu->nr_args; i++) 444 for (i = 0; i < tu->nr_args; i++)
@@ -566,10 +567,18 @@ print_uprobe_event(struct trace_iterator *iter, int flags, struct trace_event *e
566 entry = (struct uprobe_trace_entry_head *)iter->ent; 567 entry = (struct uprobe_trace_entry_head *)iter->ent;
567 tu = container_of(event, struct trace_uprobe, call.event); 568 tu = container_of(event, struct trace_uprobe, call.event);
568 569
569 if (!trace_seq_printf(s, "%s: (0x%lx)", tu->call.name, entry->vaddr[0])) 570 if (is_ret_probe(tu)) {
570 goto partial; 571 if (!trace_seq_printf(s, "%s: (0x%lx <- 0x%lx)", tu->call.name,
572 entry->vaddr[1], entry->vaddr[0]))
573 goto partial;
574 data = DATAOF_TRACE_ENTRY(entry, true);
575 } else {
576 if (!trace_seq_printf(s, "%s: (0x%lx)", tu->call.name,
577 entry->vaddr[0]))
578 goto partial;
579 data = DATAOF_TRACE_ENTRY(entry, false);
580 }
571 581
572 data = DATAOF_TRACE_ENTRY(entry, false);
573 for (i = 0; i < tu->nr_args; i++) { 582 for (i = 0; i < tu->nr_args; i++) {
574 if (!tu->args[i].type->print(s, tu->args[i].name, 583 if (!tu->args[i].type->print(s, tu->args[i].name,
575 data + tu->args[i].offset, entry)) 584 data + tu->args[i].offset, entry))