diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-02-26 10:54:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-30 21:52:11 -0700 |
commit | 7ba8b86fa59aee2895bb94824768c2217fd92623 (patch) | |
tree | 01cb2f8e9bcf9f2928ab59bdce1b4e8a676493b5 /kernel | |
parent | c5e4ef499cfc78de45a4f01b8c557b5964d77c53 (diff) | |
download | lwn-7ba8b86fa59aee2895bb94824768c2217fd92623.tar.gz lwn-7ba8b86fa59aee2895bb94824768c2217fd92623.zip |
tracepoint: Do not waste memory on mods with no tracepoints
commit 7dec935a3aa04412cba2cebe1524ae0d34a30c24 upstream.
No reason to allocate tp_module structures for modules that have no
tracepoints. This just wastes memory.
Fixes: b75ef8b44b1c "Tracepoint: Dissociate from module mutex"
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/tracepoint.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index 031cc5655a51..63630aef3bd3 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c @@ -641,6 +641,9 @@ static int tracepoint_module_coming(struct module *mod) struct tp_module *tp_mod, *iter; int ret = 0; + if (!mod->num_tracepoints) + return 0; + /* * We skip modules that taint the kernel, especially those with different * module headers (for forced load), to make sure we don't cause a crash. @@ -684,6 +687,9 @@ static int tracepoint_module_going(struct module *mod) { struct tp_module *pos; + if (!mod->num_tracepoints) + return 0; + mutex_lock(&tracepoints_mutex); tracepoint_update_probe_range(mod->tracepoints_ptrs, mod->tracepoints_ptrs + mod->num_tracepoints); |