diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-12-07 22:14:36 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-12-13 12:34:23 -0500 |
commit | 614a71a26ba3d97e9fa85649db69a682b78e407d (patch) | |
tree | f0e52c9fa62f4e4230bc2ead2449caae3b30ff87 /kernel/trace/trace_events.c | |
parent | 87d9b4e1c52867a45331a9a5495f6448e0c68b23 (diff) |
tracing: Pull up calls to trace_define_common_fields()
Call trace_define_common_fields() in event_create_dir() only.
This avoids trace events to handle it from their define_fields
callbacks and shrinks the kernel code size:
text data bss dec hex filename
5346802 1961864 7103260 14411926 dbe896 vmlinux.o.old
5345151 1961864 7103260 14410275 dbe223 vmlinux.o
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
LKML-Reference: <4B1DC49C.8000107@cn.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r-- | kernel/trace/trace_events.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 8ed66e0d476b..97b0b3aa166d 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -78,7 +78,7 @@ EXPORT_SYMBOL_GPL(trace_define_field); | |||
78 | if (ret) \ | 78 | if (ret) \ |
79 | return ret; | 79 | return ret; |
80 | 80 | ||
81 | int trace_define_common_fields(struct ftrace_event_call *call) | 81 | static int trace_define_common_fields(struct ftrace_event_call *call) |
82 | { | 82 | { |
83 | int ret; | 83 | int ret; |
84 | struct trace_entry ent; | 84 | struct trace_entry ent; |
@@ -91,7 +91,6 @@ int trace_define_common_fields(struct ftrace_event_call *call) | |||
91 | 91 | ||
92 | return ret; | 92 | return ret; |
93 | } | 93 | } |
94 | EXPORT_SYMBOL_GPL(trace_define_common_fields); | ||
95 | 94 | ||
96 | void trace_destroy_fields(struct ftrace_event_call *call) | 95 | void trace_destroy_fields(struct ftrace_event_call *call) |
97 | { | 96 | { |
@@ -927,7 +926,9 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events, | |||
927 | id); | 926 | id); |
928 | 927 | ||
929 | if (call->define_fields) { | 928 | if (call->define_fields) { |
930 | ret = call->define_fields(call); | 929 | ret = trace_define_common_fields(call); |
930 | if (!ret) | ||
931 | ret = call->define_fields(call); | ||
931 | if (ret < 0) { | 932 | if (ret < 0) { |
932 | pr_warning("Could not initialize trace point" | 933 | pr_warning("Could not initialize trace point" |
933 | " events/%s\n", call->name); | 934 | " events/%s\n", call->name); |