Skip to content

Commit

Permalink
tracing: Have syscall tracing call its own init function
Browse files Browse the repository at this point in the history
In the clean up of having all events call one specific function,
the syscall event init was changed to call this helper function.

With the new print_fmt updates, the syscalls need to do special
initializations. This patch converts the syscall events to call
its own init function again.

Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jan 6, 2010
1 parent a342a02 commit c7ef3a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct perf_event_attr;
.name = "sys_enter"#sname, \
.system = "syscalls", \
.event = &enter_syscall_print_##sname, \
.raw_init = trace_event_raw_init, \
.raw_init = init_syscall_trace, \
.show_format = syscall_enter_format, \
.define_fields = syscall_enter_define_fields, \
.regfunc = reg_event_syscall_enter, \
Expand All @@ -165,7 +165,7 @@ struct perf_event_attr;
.name = "sys_exit"#sname, \
.system = "syscalls", \
.event = &exit_syscall_print_##sname, \
.raw_init = trace_event_raw_init, \
.raw_init = init_syscall_trace, \
.show_format = syscall_exit_format, \
.define_fields = syscall_exit_define_fields, \
.regfunc = reg_event_syscall_exit, \
Expand Down
12 changes: 6 additions & 6 deletions kernel/trace/trace_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,14 @@ int init_syscall_trace(struct ftrace_event_call *call)
if (set_syscall_print_fmt(call) < 0)
return -ENOMEM;

id = register_ftrace_event(call->event);
if (!id) {
id = trace_event_raw_init(call);

if (id < 0) {
free_syscall_print_fmt(call);
return -ENODEV;
return id;
}
call->id = id;
INIT_LIST_HEAD(&call->fields);
return 0;

return id;
}

int __init init_ftrace_syscalls(void)
Expand Down

0 comments on commit c7ef3a9

Please sign in to comment.