Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169843
b: refs/heads/master
c: a1301da
h: refs/heads/master
i:
  169841: 0f3467c
  169839: 4d88924
v: v3
  • Loading branch information
Lai Jiangshan authored and Ingo Molnar committed Dec 1, 2009
1 parent e976e97 commit 7766c25
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 29 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: c252f65793874b56d50395ab604db465ce688665
refs/heads/master: a1301da0997bf73c44dbe584e9070a13adc89672
30 changes: 2 additions & 28 deletions trunk/include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,6 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \
struct trace_event enter_syscall_print_##sname = { \
.trace = print_syscall_enter, \
}; \
static int init_enter_##sname(struct ftrace_event_call *call) \
{ \
int num, id; \
num = __syscall_meta_##sname.syscall_nr; \
if (num < 0) \
return -ENOSYS; \
id = register_ftrace_event(&enter_syscall_print_##sname);\
if (!id) \
return -ENODEV; \
event_enter_##sname.id = id; \
INIT_LIST_HEAD(&event_enter_##sname.fields); \
return 0; \
} \
TRACE_SYS_ENTER_PROFILE(sname); \
static struct ftrace_event_call __used \
__attribute__((__aligned__(4))) \
Expand All @@ -179,7 +166,7 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \
.name = "sys_enter"#sname, \
.system = "syscalls", \
.event = &enter_syscall_print_##sname, \
.raw_init = init_enter_##sname, \
.raw_init = init_syscall_trace, \
.show_format = syscall_enter_format, \
.define_fields = syscall_enter_define_fields, \
.regfunc = reg_event_syscall_enter, \
Expand All @@ -194,19 +181,6 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \
struct trace_event exit_syscall_print_##sname = { \
.trace = print_syscall_exit, \
}; \
static int init_exit_##sname(struct ftrace_event_call *call) \
{ \
int num, id; \
num = __syscall_meta_##sname.syscall_nr; \
if (num < 0) \
return -ENOSYS; \
id = register_ftrace_event(&exit_syscall_print_##sname);\
if (!id) \
return -ENODEV; \
event_exit_##sname.id = id; \
INIT_LIST_HEAD(&event_exit_##sname.fields); \
return 0; \
} \
TRACE_SYS_EXIT_PROFILE(sname); \
static struct ftrace_event_call __used \
__attribute__((__aligned__(4))) \
Expand All @@ -215,7 +189,7 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \
.name = "sys_exit"#sname, \
.system = "syscalls", \
.event = &exit_syscall_print_##sname, \
.raw_init = init_exit_##sname, \
.raw_init = init_syscall_trace, \
.show_format = syscall_exit_format, \
.define_fields = syscall_exit_define_fields, \
.regfunc = reg_event_syscall_exit, \
Expand Down
1 change: 1 addition & 0 deletions trunk/include/trace/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct syscall_metadata {

#ifdef CONFIG_FTRACE_SYSCALLS
extern unsigned long arch_syscall_addr(int nr);
extern int init_syscall_trace(struct ftrace_event_call *call);

extern int syscall_enter_format(struct ftrace_event_call *call,
struct trace_seq *s);
Expand Down
12 changes: 12 additions & 0 deletions trunk/kernel/trace/trace_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,18 @@ void unreg_event_syscall_exit(struct ftrace_event_call *call)
mutex_unlock(&syscall_trace_lock);
}

int init_syscall_trace(struct ftrace_event_call *call)
{
int id;

id = register_ftrace_event(call->event);
if (!id)
return -ENODEV;
call->id = id;
INIT_LIST_HEAD(&call->fields);
return 0;
}

int __init init_ftrace_syscalls(void)
{
struct syscall_metadata *meta;
Expand Down

0 comments on commit 7766c25

Please sign in to comment.