diff options
author | Li Zefan <lizefan@huawei.com> | 2013-02-20 21:33:33 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-03-15 00:34:51 -0400 |
commit | 7e4f44b153e1ec07bb64c1c1671cdf492465bbf3 (patch) | |
tree | 7477c5f2e6e904391204ac5899bb32f59fb083bc | |
parent | f71130de5c7fba92faf3901784714e37a234c08f (diff) |
tracing: Annotate event field-defining functions with __init
Those functions are called either during kernel boot or module init.
Before:
$ dmesg | grep 'Freeing unused kernel memory'
Freeing unused kernel memory: 1208k freed
Freeing unused kernel memory: 1360k freed
Freeing unused kernel memory: 1960k freed
After:
$ dmesg | grep 'Freeing unused kernel memory'
Freeing unused kernel memory: 1236k freed
Freeing unused kernel memory: 1388k freed
Freeing unused kernel memory: 1960k freed
Link: http://lkml.kernel.org/r/5125877D.5000201@huawei.com
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | include/trace/ftrace.h | 2 | ||||
-rw-r--r-- | kernel/trace/trace_export.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 17a77fcac2a2..a536f66f84c6 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -324,7 +324,7 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \ | |||
324 | 324 | ||
325 | #undef DECLARE_EVENT_CLASS | 325 | #undef DECLARE_EVENT_CLASS |
326 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ | 326 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ |
327 | static int notrace \ | 327 | static int notrace __init \ |
328 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | 328 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ |
329 | { \ | 329 | { \ |
330 | struct ftrace_raw_##call field; \ | 330 | struct ftrace_raw_##call field; \ |
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index e039906b037d..4f6a91c1370c 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -129,7 +129,7 @@ static void __always_unused ____ftrace_check_##name(void) \ | |||
129 | 129 | ||
130 | #undef FTRACE_ENTRY | 130 | #undef FTRACE_ENTRY |
131 | #define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter) \ | 131 | #define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter) \ |
132 | int \ | 132 | static int __init \ |
133 | ftrace_define_fields_##name(struct ftrace_event_call *event_call) \ | 133 | ftrace_define_fields_##name(struct ftrace_event_call *event_call) \ |
134 | { \ | 134 | { \ |
135 | struct struct_name field; \ | 135 | struct struct_name field; \ |