lkml.org 
[lkml]   [2009]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/13] tracing: Extract duplicate ftrace_raw_init_event_foo()
On Tue, Dec 08, 2009 at 11:14:20AM +0800, Li Zefan wrote:
> Define ftrace_raw_init_event_foo() for each event class rather
> than for each event:
>
> text data bss dec hex filename
> 5355293 1961928 7103260 14420481 dc0a01 vmlinux.o.old
> 5346802 1961864 7103260 14411926 dbe896 vmlinux.o
>
> raw_init can't be removed, because ftrace events and kprobe events
> use different raw_init callbacks. Though it's possible to totally
> remove raw_init, I choose to leave it as it is for now.
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
> include/linux/ftrace_event.h | 1 +
> include/linux/syscalls.h | 4 ++--
> include/trace/ftrace.h | 35 ++++-------------------------------
> kernel/trace/trace_events.c | 14 ++++++++++++++
> 4 files changed, 21 insertions(+), 33 deletions(-)
>
> diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
> index 47bbdf9..cdea8a9 100644
> --- a/include/linux/ftrace_event.h
> +++ b/include/linux/ftrace_event.h
> @@ -157,6 +157,7 @@ enum {
> FILTER_PTR_STRING,
> };
>
> +extern int trace_event_raw_init(struct ftrace_event_call *call);
> extern int trace_define_common_fields(struct ftrace_event_call *call);
> extern int trace_define_field(struct ftrace_event_call *call, const char *type,
> const char *name, int offset, int size,
> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
> index e79e2f3..55e7108 100644
> --- a/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -144,7 +144,7 @@ struct perf_event_attr;
> .name = "sys_enter"#sname, \
> .system = "syscalls", \
> .event = &enter_syscall_print_##sname, \
> - .raw_init = init_syscall_trace, \
> + .raw_init = trace_event_raw_init, \
> .show_format = syscall_enter_format, \
> .define_fields = syscall_enter_define_fields, \
> .regfunc = reg_event_syscall_enter, \
> @@ -166,7 +166,7 @@ struct perf_event_attr;
> .name = "sys_exit"#sname, \
> .system = "syscalls", \
> .event = &exit_syscall_print_##sname, \
> - .raw_init = init_syscall_trace, \
> + .raw_init = trace_event_raw_init, \



Nice cleanup.
BTW, init_syscall_trace is left unused now. Could you please
remove it too?

And add my Acked-by. Thanks!



\
 
 \ /
  Last update: 2009-12-08 08:33    [W:0.148 / U:4.640 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site