diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 2d537186191f..46580edff0cb 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -55,6 +55,11 @@ | |||
55 | #include <linux/percpu.h> | 55 | #include <linux/percpu.h> |
56 | #include <linux/kmemleak.h> | 56 | #include <linux/kmemleak.h> |
57 | 57 | ||
58 | #define CREATE_TRACE_POINTS | ||
59 | #include <trace/events/module.h> | ||
60 | |||
61 | EXPORT_TRACEPOINT_SYMBOL(module_get); | ||
62 | |||
58 | #if 0 | 63 | #if 0 |
59 | #define DEBUGP printk | 64 | #define DEBUGP printk |
60 | #else | 65 | #else |
@@ -942,6 +947,8 @@ void module_put(struct module *module) | |||
942 | if (module) { | 947 | if (module) { |
943 | unsigned int cpu = get_cpu(); | 948 | unsigned int cpu = get_cpu(); |
944 | local_dec(__module_ref_addr(module, cpu)); | 949 | local_dec(__module_ref_addr(module, cpu)); |
950 | trace_module_put(module, _RET_IP_, | ||
951 | local_read(__module_ref_addr(module, cpu))); | ||
945 | /* Maybe they're waiting for us to drop reference? */ | 952 | /* Maybe they're waiting for us to drop reference? */ |
946 | if (unlikely(!module_is_live(module))) | 953 | if (unlikely(!module_is_live(module))) |
947 | wake_up_process(module->waiter); | 954 | wake_up_process(module->waiter); |
@@ -1497,6 +1504,8 @@ static int __unlink_module(void *_mod) | |||
1497 | /* Free a module, remove from lists, etc (must hold module_mutex). */ | 1504 | /* Free a module, remove from lists, etc (must hold module_mutex). */ |
1498 | static void free_module(struct module *mod) | 1505 | static void free_module(struct module *mod) |
1499 | { | 1506 | { |
1507 | trace_module_free(mod); | ||
1508 | |||
1500 | /* Delete from various lists */ | 1509 | /* Delete from various lists */ |
1501 | stop_machine(__unlink_module, mod, NULL); | 1510 | stop_machine(__unlink_module, mod, NULL); |
1502 | remove_notes_attrs(mod); | 1511 | remove_notes_attrs(mod); |
@@ -2364,6 +2373,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2364 | /* Get rid of temporary copy */ | 2373 | /* Get rid of temporary copy */ |
2365 | vfree(hdr); | 2374 | vfree(hdr); |
2366 | 2375 | ||
2376 | trace_module_load(mod); | ||
2377 | |||
2367 | /* Done! */ | 2378 | /* Done! */ |
2368 | return mod; | 2379 | return mod; |
2369 | 2380 | ||