Commit 7e4f44b1 authored by Li Zefan's avatar Li Zefan Committed by Steven Rostedt

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.comSigned-off-by: default avatarLi Zefan <lizefan@huawei.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent f71130de
...@@ -324,7 +324,7 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \ ...@@ -324,7 +324,7 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \
#undef DECLARE_EVENT_CLASS #undef DECLARE_EVENT_CLASS
#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
static int notrace \ static int notrace __init \
ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
{ \ { \
struct ftrace_raw_##call field; \ struct ftrace_raw_##call field; \
......
...@@ -129,7 +129,7 @@ static void __always_unused ____ftrace_check_##name(void) \ ...@@ -129,7 +129,7 @@ static void __always_unused ____ftrace_check_##name(void) \
#undef FTRACE_ENTRY #undef FTRACE_ENTRY
#define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter) \ #define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter) \
int \ static int __init \
ftrace_define_fields_##name(struct ftrace_event_call *event_call) \ ftrace_define_fields_##name(struct ftrace_event_call *event_call) \
{ \ { \
struct struct_name field; \ struct struct_name field; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment