diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-09-10 19:53:45 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-11 00:09:47 -0400 |
commit | 6e9f23d1619f7badaf9090dac09e86a22d6061d8 (patch) | |
tree | 6215ecf193b98f8f2e813dc21b47cc0cfc233852 /kernel/trace | |
parent | eca0d916f6429785bbc88db3ff66631cde62b432 (diff) |
tracing/kprobes: Show event name in trace output
Show event name in tracing/trace output. This also fixes kprobes events
format to comply with other tracepoint events formats.
Before patching:
<...>-1447 [001] 1038282.286875: do_sys_open+0x0/0xd6: ...
<...>-1447 [001] 1038282.286878: sys_openat+0xc/0xe <- do_sys_open: ...
After patching:
<...>-1447 [001] 1038282.286875: myprobe: (do_sys_open+0x0/0xd6) ...
<...>-1447 [001] 1038282.286878: myretprobe: (sys_openat+0xc/0xe <- do_sys_open) ...
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <20090910235345.22412.76527.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_kprobe.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 44dad1aa95d3..1746afeaabf9 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -902,10 +902,13 @@ print_kprobe_event(struct trace_iterator *iter, int flags) | |||
902 | event = ftrace_find_event(field->ent.type); | 902 | event = ftrace_find_event(field->ent.type); |
903 | tp = container_of(event, struct trace_probe, event); | 903 | tp = container_of(event, struct trace_probe, event); |
904 | 904 | ||
905 | if (!trace_seq_printf(s, "%s: (", tp->call.name)) | ||
906 | goto partial; | ||
907 | |||
905 | if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET)) | 908 | if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET)) |
906 | goto partial; | 909 | goto partial; |
907 | 910 | ||
908 | if (!trace_seq_puts(s, ":")) | 911 | if (!trace_seq_puts(s, ")")) |
909 | goto partial; | 912 | goto partial; |
910 | 913 | ||
911 | for (i = 0; i < field->nargs; i++) | 914 | for (i = 0; i < field->nargs; i++) |
@@ -934,6 +937,9 @@ print_kretprobe_event(struct trace_iterator *iter, int flags) | |||
934 | event = ftrace_find_event(field->ent.type); | 937 | event = ftrace_find_event(field->ent.type); |
935 | tp = container_of(event, struct trace_probe, event); | 938 | tp = container_of(event, struct trace_probe, event); |
936 | 939 | ||
940 | if (!trace_seq_printf(s, "%s: (", tp->call.name)) | ||
941 | goto partial; | ||
942 | |||
937 | if (!seq_print_ip_sym(s, field->ret_ip, flags | TRACE_ITER_SYM_OFFSET)) | 943 | if (!seq_print_ip_sym(s, field->ret_ip, flags | TRACE_ITER_SYM_OFFSET)) |
938 | goto partial; | 944 | goto partial; |
939 | 945 | ||
@@ -943,7 +949,7 @@ print_kretprobe_event(struct trace_iterator *iter, int flags) | |||
943 | if (!seq_print_ip_sym(s, field->func, flags & ~TRACE_ITER_SYM_OFFSET)) | 949 | if (!seq_print_ip_sym(s, field->func, flags & ~TRACE_ITER_SYM_OFFSET)) |
944 | goto partial; | 950 | goto partial; |
945 | 951 | ||
946 | if (!trace_seq_puts(s, ":")) | 952 | if (!trace_seq_puts(s, ")")) |
947 | goto partial; | 953 | goto partial; |
948 | 954 | ||
949 | for (i = 0; i < field->nargs; i++) | 955 | for (i = 0; i < field->nargs; i++) |
@@ -1087,7 +1093,7 @@ static int kprobe_event_show_format(struct ftrace_event_call *call, | |||
1087 | SHOW_FIELD(unsigned long, args[i], tp->args[i].name); | 1093 | SHOW_FIELD(unsigned long, args[i], tp->args[i].name); |
1088 | trace_seq_puts(s, "\n"); | 1094 | trace_seq_puts(s, "\n"); |
1089 | 1095 | ||
1090 | return __probe_event_show_format(s, tp, "%lx:", "ip"); | 1096 | return __probe_event_show_format(s, tp, "(%lx)", "REC->ip"); |
1091 | } | 1097 | } |
1092 | 1098 | ||
1093 | static int kretprobe_event_show_format(struct ftrace_event_call *call, | 1099 | static int kretprobe_event_show_format(struct ftrace_event_call *call, |
@@ -1106,8 +1112,8 @@ static int kretprobe_event_show_format(struct ftrace_event_call *call, | |||
1106 | SHOW_FIELD(unsigned long, args[i], tp->args[i].name); | 1112 | SHOW_FIELD(unsigned long, args[i], tp->args[i].name); |
1107 | trace_seq_puts(s, "\n"); | 1113 | trace_seq_puts(s, "\n"); |
1108 | 1114 | ||
1109 | return __probe_event_show_format(s, tp, "%lx <- %lx:", | 1115 | return __probe_event_show_format(s, tp, "(%lx <- %lx)", |
1110 | "func, ret_ip"); | 1116 | "REC->func, REC->ret_ip"); |
1111 | } | 1117 | } |
1112 | 1118 | ||
1113 | #ifdef CONFIG_EVENT_PROFILE | 1119 | #ifdef CONFIG_EVENT_PROFILE |