Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158444
b: refs/heads/master
c: 10a5b66
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Aug 19, 2009
1 parent 99ee596 commit 6fc1619
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e6971969c331caa5c3c88cbd1be4f465b3355452
refs/heads/master: 10a5b66f625904ad5a2867cf7a28073e1236ff32
3 changes: 2 additions & 1 deletion trunk/include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *event_call) \
.system = "syscalls", \
.event = &event_syscall_enter, \
.raw_init = init_enter_##sname, \
.show_format = ftrace_format_syscall, \
.show_format = syscall_enter_format, \
.regfunc = reg_event_syscall_enter, \
.unregfunc = unreg_event_syscall_enter, \
.data = "sys"#sname, \
Expand Down Expand Up @@ -225,6 +225,7 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *event_call) \
.system = "syscalls", \
.event = &event_syscall_exit, \
.raw_init = init_exit_##sname, \
.show_format = syscall_exit_format, \
.regfunc = reg_event_syscall_exit, \
.unregfunc = unreg_event_syscall_exit, \
.data = "sys"#sname, \
Expand Down
6 changes: 4 additions & 2 deletions trunk/include/trace/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ extern int reg_event_syscall_enter(void *ptr);
extern void unreg_event_syscall_enter(void *ptr);
extern int reg_event_syscall_exit(void *ptr);
extern void unreg_event_syscall_exit(void *ptr);
extern int
ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
extern int syscall_enter_format(struct ftrace_event_call *call,
struct trace_seq *s);
extern int syscall_exit_format(struct ftrace_event_call *call,
struct trace_seq *s);
enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags);
enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags);
#endif
Expand Down
18 changes: 17 additions & 1 deletion trunk/kernel/trace/trace_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ extern char *__bad_type_size(void);
__bad_type_size() : \
#type, #name, offsetof(typeof(trace), name), sizeof(trace.name)

int ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s)
int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
{
int i;
int nr;
Expand Down Expand Up @@ -149,6 +149,22 @@ int ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s)
return ret;
}

int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
{
int ret;
struct syscall_trace_exit trace;

ret = trace_seq_printf(s,
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n",
SYSCALL_FIELD(int, nr),
SYSCALL_FIELD(unsigned long, ret));
if (!ret)
return 0;

return trace_seq_printf(s, "\nprint fmt: \"0x%%lx\", REC->ret\n");
}

void ftrace_syscall_enter(struct pt_regs *regs, long id)
{
struct syscall_trace_enter *entry;
Expand Down

0 comments on commit 6fc1619

Please sign in to comment.