diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-04-10 14:53:50 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-04-14 12:58:03 -0400 |
commit | 6d723736e472f7a0cd5b62c84152fceead241328 (patch) | |
tree | 8df2f6c47ebdfdeb8979758c877a5abbd9c06aef /kernel/module.c | |
parent | 17c873ec280a03894bc718af817f7f24fa787ae1 (diff) |
tracing/events: add support for modules to TRACE_EVENT
Impact: allow modules to add TRACE_EVENTS on load
This patch adds the final hooks to allow modules to use the TRACE_EVENT
macro. A notifier and a data structure are used to link the TRACE_EVENTs
defined in the module to connect them with the ftrace event tracing system.
It also adds the necessary automated clean ups to the trace events when a
module is removed.
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index e797812a4d9..a0394706f10 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -18,6 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/moduleloader.h> | 20 | #include <linux/moduleloader.h> |
21 | #include <linux/ftrace_event.h> | ||
21 | #include <linux/init.h> | 22 | #include <linux/init.h> |
22 | #include <linux/kallsyms.h> | 23 | #include <linux/kallsyms.h> |
23 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
@@ -2172,6 +2173,12 @@ static noinline struct module *load_module(void __user *umod, | |||
2172 | sizeof(*mod->tracepoints), | 2173 | sizeof(*mod->tracepoints), |
2173 | &mod->num_tracepoints); | 2174 | &mod->num_tracepoints); |
2174 | #endif | 2175 | #endif |
2176 | #ifdef CONFIG_EVENT_TRACING | ||
2177 | mod->trace_events = section_objs(hdr, sechdrs, secstrings, | ||
2178 | "_ftrace_events", | ||
2179 | sizeof(*mod->trace_events), | ||
2180 | &mod->num_trace_events); | ||
2181 | #endif | ||
2175 | 2182 | ||
2176 | #ifdef CONFIG_MODVERSIONS | 2183 | #ifdef CONFIG_MODVERSIONS |
2177 | if ((mod->num_syms && !mod->crcs) | 2184 | if ((mod->num_syms && !mod->crcs) |