diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-08-19 03:53:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-19 09:02:23 -0400 |
commit | 10a5b66f625904ad5a2867cf7a28073e1236ff32 (patch) | |
tree | 165c3d0f480e2862d3d97f3f3ceecad9c1cdc8b8 /kernel | |
parent | e6971969c331caa5c3c88cbd1be4f465b3355452 (diff) |
tracing/syscalls: Add fields format for exit events
Add "format" file for syscall exit events:
# cat events/syscalls/sys_exit_open/format
name: sys_exit_open
ID: 344
format:
field:unsigned short common_type; offset:0; size:2;
field:unsigned char common_flags; offset:2; size:1;
field:unsigned char common_preempt_count; offset:3; size:1;
field:int common_pid; offset:4; size:4;
field:int common_tgid; offset:8; size:4;
field:int nr; offset:12; size:4;
field:unsigned long ret; offset:16; size:4;
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4A8BAF61.3060307@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_syscalls.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index d10daf0922b5..7336b6c265d7 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -97,7 +97,7 @@ extern char *__bad_type_size(void); | |||
97 | __bad_type_size() : \ | 97 | __bad_type_size() : \ |
98 | #type, #name, offsetof(typeof(trace), name), sizeof(trace.name) | 98 | #type, #name, offsetof(typeof(trace), name), sizeof(trace.name) |
99 | 99 | ||
100 | int ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s) | 100 | int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s) |
101 | { | 101 | { |
102 | int i; | 102 | int i; |
103 | int nr; | 103 | int nr; |
@@ -149,6 +149,22 @@ int ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s) | |||
149 | return ret; | 149 | return ret; |
150 | } | 150 | } |
151 | 151 | ||
152 | int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s) | ||
153 | { | ||
154 | int ret; | ||
155 | struct syscall_trace_exit trace; | ||
156 | |||
157 | ret = trace_seq_printf(s, | ||
158 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" | ||
159 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", | ||
160 | SYSCALL_FIELD(int, nr), | ||
161 | SYSCALL_FIELD(unsigned long, ret)); | ||
162 | if (!ret) | ||
163 | return 0; | ||
164 | |||
165 | return trace_seq_printf(s, "\nprint fmt: \"0x%%lx\", REC->ret\n"); | ||
166 | } | ||
167 | |||
152 | void ftrace_syscall_enter(struct pt_regs *regs, long id) | 168 | void ftrace_syscall_enter(struct pt_regs *regs, long id) |
153 | { | 169 | { |
154 | struct syscall_trace_enter *entry; | 170 | struct syscall_trace_enter *entry; |