[3.11.y.z extended stable] Patch "tracepoint: Do not waste memory on mods with no tracepoints" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Wed May 14 14:58:11 UTC 2014

This is a note to let you know that I have just added a patch titled

    tracepoint: Do not waste memory on mods with no tracepoints

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see



>From 752fa1815a6798649ca58660d1b5cdc76ff3ee3d Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Red Hat)" <rostedt at goodmis.org>
Date: Wed, 26 Feb 2014 10:54:36 -0500
Subject: 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 at efficios.com>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
 kernel/tracepoint.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index 031cc56..63630ae 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;
 		mod->tracepoints_ptrs + mod->num_tracepoints);

More information about the kernel-team mailing list