[PATCH 06/10][RFC] tracing: Move raw_init from events to class

Previous thread: [PATCH 01/10][RFC] tracing: Create class struct for events by Steven Rostedt on Monday, April 26, 2010 - 12:50 pm. (3 messages)

Next thread: [PATCH 07/10][RFC] tracing: Allow events to share their print functions by Steven Rostedt on Monday, April 26, 2010 - 12:50 pm. (2 messages)
From: Steven Rostedt
Date: Monday, April 26, 2010 - 12:50 pm

From: Steven Rostedt <srostedt@redhat.com>

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 <rostedt@goodmis.org>
---
 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 ...
From: Mathieu Desnoyers
Date: Wednesday, April 28, 2010 - 2:00 pm

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--

Previous thread: [PATCH 01/10][RFC] tracing: Create class struct for events by Steven Rostedt on Monday, April 26, 2010 - 12:50 pm. (3 messages)

Next thread: [PATCH 07/10][RFC] tracing: Allow events to share their print functions by Steven Rostedt on Monday, April 26, 2010 - 12:50 pm. (2 messages)