Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755892Ab0D1VAM (ORCPT ); Wed, 28 Apr 2010 17:00:12 -0400 Received: from tomts13.bellnexxia.net ([209.226.175.34]:59817 "EHLO tomts13-srv.bellnexxia.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754856Ab0D1VAK (ORCPT ); Wed, 28 Apr 2010 17:00:10 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAPs+2EtGGNqG/2dsb2JhbACce3K+OIUOBA Date: Wed, 28 Apr 2010 17:00:00 -0400 From: Mathieu Desnoyers To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Frederic Weisbecker , Arnaldo Carvalho de Melo , Lai Jiangshan , Li Zefan , Masami Hiramatsu , Christoph Hellwig Subject: Re: [PATCH 06/10][RFC] tracing: Move raw_init from events to class Message-ID: <20100428210000.GG8591@Krystal> References: <20100426195024.256424113@goodmis.org> <20100426200242.757929062@goodmis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <20100426200242.757929062@goodmis.org> X-Editor: vi X-Info: http://krystal.dyndns.org:8080 X-Operating-System: Linux/2.6.27.31-grsec (i686) X-Uptime: 16:59:48 up 21 days, 6:53, 4 users, load average: 0.02, 0.14, 0.18 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9048 Lines: 232 * Steven Rostedt (rostedt@goodmis.org) wrote: > From: Steven Rostedt > > The raw_init function pointer in the event is used to initialize > various kinds of events. The type of initialization needed is usually > classed to the kind of event it is. > > Two events with the same class will always have the same initialization > function, so it makes sense to move this to the class structure. > > Perhaps even making a special system structure would work since > the initialization is the same for all events within a system. > But since there's no system structure (yet), this will just move it > to the class. > > text data bss dec hex filename > 5788186 1337252 9351592 16477030 fb6b66 vmlinux.orig > 5774567 1297492 9351592 16423651 fa9ae3 vmlinux.fields > 5774510 1293204 9351592 16419306 fa89ea vmlinux.init > > The text grew very slightly, but this is a constant growth that happened > with the changing of the C files that call the init code. > The bigger savings is the data which will be saved the more events share > a class. > > Signed-off-by: Steven Rostedt Acked-by: Mathieu Desnoyers > --- > include/linux/ftrace_event.h | 2 +- > include/linux/syscalls.h | 2 -- > include/trace/ftrace.h | 8 ++++---- > kernel/trace/trace_events.c | 12 ++++++------ > kernel/trace/trace_export.c | 2 +- > kernel/trace/trace_kprobe.c | 6 +++--- > kernel/trace/trace_syscalls.c | 2 ++ > 7 files changed, 17 insertions(+), 17 deletions(-) > > diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h > index 1e2c8f5..655de69 100644 > --- a/include/linux/ftrace_event.h > +++ b/include/linux/ftrace_event.h > @@ -131,6 +131,7 @@ struct ftrace_event_class { > int (*define_fields)(struct ftrace_event_call *); > struct list_head *(*get_fields)(struct ftrace_event_call *); > struct list_head fields; > + int (*raw_init)(struct ftrace_event_call *); > }; > > struct ftrace_event_call { > @@ -142,7 +143,6 @@ struct ftrace_event_call { > int enabled; > int id; > const char *print_fmt; > - int (*raw_init)(struct ftrace_event_call *); > int filter_active; > struct event_filter *filter; > void *mod; > diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h > index ef4f81c..a0db1e8 100644 > --- a/include/linux/syscalls.h > +++ b/include/linux/syscalls.h > @@ -135,7 +135,6 @@ extern struct ftrace_event_class event_class_syscall_exit; > .name = "sys_enter"#sname, \ > .class = &event_class_syscall_enter, \ > .event = &enter_syscall_print_##sname, \ > - .raw_init = init_syscall_trace, \ > .data = (void *)&__syscall_meta_##sname,\ > } > > @@ -153,7 +152,6 @@ extern struct ftrace_event_class event_class_syscall_exit; > .name = "sys_exit"#sname, \ > .class = &event_class_syscall_exit, \ > .event = &exit_syscall_print_##sname, \ > - .raw_init = init_syscall_trace, \ > .data = (void *)&__syscall_meta_##sname,\ > } > > diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h > index e6ec392..de0d96c 100644 > --- a/include/trace/ftrace.h > +++ b/include/trace/ftrace.h > @@ -430,8 +430,9 @@ static inline notrace int ftrace_get_offsets_##call( \ > * static struct ftrace_event_class __used event_class_