aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kmod.c4
-rw-r--r--kernel/module.c11
2 files changed, 15 insertions, 0 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 385c31a1bdb..a92280870e3 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -37,6 +37,8 @@
37#include <linux/suspend.h> 37#include <linux/suspend.h>
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
39 39
40#include <trace/events/module.h>
41
40extern int max_threads; 42extern int max_threads;
41 43
42static struct workqueue_struct *khelper_wq; 44static struct workqueue_struct *khelper_wq;
@@ -108,6 +110,8 @@ int __request_module(bool wait, const char *fmt, ...)
108 return -ENOMEM; 110 return -ENOMEM;
109 } 111 }
110 112
113 trace_module_request(module_name, wait, _RET_IP_);
114
111 ret = call_usermodehelper(modprobe_path, argv, envp, 115 ret = call_usermodehelper(modprobe_path, argv, envp,
112 wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC); 116 wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC);
113 atomic_dec(&kmod_concurrent); 117 atomic_dec(&kmod_concurrent);
diff --git a/kernel/module.c b/kernel/module.c
index fd141140355..b1821438694 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
61EXPORT_TRACEPOINT_SYMBOL(module_get);
62
58#if 0 63#if 0
59#define DEBUGP printk 64#define DEBUGP printk
60#else 65#else
@@ -940,6 +945,8 @@ void module_put(struct module *module)
940 if (module) { 945 if (module) {
941 unsigned int cpu = get_cpu(); 946 unsigned int cpu = get_cpu();
942 local_dec(__module_ref_addr(module, cpu)); 947 local_dec(__module_ref_addr(module, cpu));
948 trace_module_put(module, _RET_IP_,
949 local_read(__module_ref_addr(module, cpu)));
943 /* Maybe they're waiting for us to drop reference? */ 950 /* Maybe they're waiting for us to drop reference? */
944 if (unlikely(!module_is_live(module))) 951 if (unlikely(!module_is_live(module)))
945 wake_up_process(module->waiter); 952 wake_up_process(module->waiter);
@@ -1491,6 +1498,8 @@ static int __unlink_module(void *_mod)
1491/* Free a module, remove from lists, etc (must hold module_mutex). */ 1498/* Free a module, remove from lists, etc (must hold module_mutex). */
1492static void free_module(struct module *mod) 1499static void free_module(struct module *mod)
1493{ 1500{
1501 trace_module_free(mod);
1502
1494 /* Delete from various lists */ 1503 /* Delete from various lists */
1495 stop_machine(__unlink_module, mod, NULL); 1504 stop_machine(__unlink_module, mod, NULL);
1496 remove_notes_attrs(mod); 1505 remove_notes_attrs(mod);
@@ -2358,6 +2367,8 @@ static noinline struct module *load_module(void __user *umod,
2358 /* Get rid of temporary copy */ 2367 /* Get rid of temporary copy */
2359 vfree(hdr); 2368 vfree(hdr);
2360 2369
2370 trace_module_load(mod);
2371
2361 /* Done! */ 2372 /* Done! */
2362 return mod; 2373 return mod;
2363 2374