]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
2 | Subject: LTTng instrumentation - kernel | |
3 | ||
4 | Original patch header: | |
5 | LTTng instrumentation - kernel | |
6 | ||
7 | Instrument the core kernel : module load/free and printk events. It helps the | |
8 | tracer to keep track of module related events and to export valuable printk | |
9 | information into the traces. | |
10 | ||
11 | Those tracepoints are used by LTTng. | |
12 | ||
13 | About the performance impact of tracepoints (which is comparable to markers), | |
14 | even without immediate values optimizations, tests done by Hideo Aoki on ia64 | |
15 | show no regression. His test case was using hackbench on a kernel where | |
16 | scheduler instrumentation (about 5 events in code scheduler code) was added. | |
17 | See the "Tracepoints" patch header for performance result detail. | |
18 | ||
19 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | |
20 | CC: Andrew Morton <akpm@linux-foundation.org> | |
21 | CC: Masami Hiramatsu <mhiramat@redhat.com> | |
22 | CC: 'Peter Zijlstra' <peterz@infradead.org> | |
23 | CC: "Frank Ch. Eigler" <fche@redhat.com> | |
24 | CC: 'Ingo Molnar' <mingo@elte.hu> | |
25 | CC: 'Hideo AOKI' <haoki@redhat.com> | |
26 | CC: Takashi Nishiie <t-nishiie@np.css.fujitsu.com> | |
27 | CC: 'Steven Rostedt' <rostedt@goodmis.org> | |
28 | CC: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> | |
29 | ||
30 | Acked-by: Jan Blunck <jblunck@suse.de> | |
31 | --- | |
32 | --- | |
33 | include/trace/kernel.h | 13 +++++++++++++ | |
34 | kernel/module.c | 5 +++++ | |
35 | 2 files changed, 18 insertions(+) | |
36 | ||
37 | --- /dev/null | |
38 | +++ b/include/trace/kernel.h | |
39 | @@ -0,0 +1,13 @@ | |
40 | +#ifndef _TRACE_KERNEL_H | |
41 | +#define _TRACE_KERNEL_H | |
42 | + | |
43 | +#include <linux/tracepoint.h> | |
44 | + | |
45 | +DEFINE_TRACE(kernel_module_free, | |
46 | + TPPROTO(struct module *mod), | |
47 | + TPARGS(mod)); | |
48 | +DEFINE_TRACE(kernel_module_load, | |
49 | + TPPROTO(struct module *mod), | |
50 | + TPARGS(mod)); | |
51 | + | |
52 | +#endif | |
53 | --- a/kernel/module.c | |
54 | +++ b/kernel/module.c | |
55 | @@ -47,6 +47,7 @@ | |
56 | #include <linux/license.h> | |
57 | #include <asm/sections.h> | |
58 | #include <linux/tracepoint.h> | |
59 | +#include <trace/kernel.h> | |
60 | ||
61 | #if 0 | |
62 | #define DEBUGP printk | |
63 | @@ -1473,6 +1474,8 @@ static int __unlink_module(void *_mod) | |
64 | /* Free a module, remove from lists, etc (must hold module_mutex). */ | |
65 | static void free_module(struct module *mod) | |
66 | { | |
67 | + trace_kernel_module_free(mod); | |
68 | + | |
69 | /* Delete from various lists */ | |
70 | stop_machine(__unlink_module, mod, NULL); | |
71 | remove_notes_attrs(mod); | |
72 | @@ -2354,6 +2357,8 @@ static noinline struct module *load_modu | |
73 | /* Get rid of temporary copy */ | |
74 | vfree(hdr); | |
75 | ||
76 | + trace_kernel_module_load(mod); | |
77 | + | |
78 | /* Done! */ | |
79 | return mod; | |
80 |