From 0405ab80aa94afb13bf9ac4a6fc9f2923d4b9114 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Thu, 22 Apr 2010 11:46:44 -0400 Subject: [PATCH] tracing: Move raw_init from events to class 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 4913961 1088356 861512 6863829 68bbd5 vmlinux.orig 4900375 1053380 861512 6815267 67fe23 vmlinux.fields 4900382 1048964 861512 6810858 67ecea 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. Acked-by: Mathieu Desnoyers Acked-by: Masami Hiramatsu Acked-by: Frederic Weisbecker Signed-off-by: Steven Rostedt --- include/linux/ftrace_event.h | 2 +- include/linux/syscalls.h | 2 -- include/trace/ftrace.h | 9 ++++----- 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(+), 18 deletions(-) diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 479c3c1876e6c4..393a8394df0e2c 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h @@ -133,6 +133,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 { @@ -144,7 +145,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 fd0f1f248cd8cf..211c704a71edac 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 c7e3bcd5d52f0c..e7eb33420b0671 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h @@ -431,8 +431,9 @@ static inline notrace int ftrace_get_offsets_##call( \ * static struct ftrace_event_class __used event_class_