[lttng-dev] [RFC PATCH lttng-tools 5/5] Add builtin modules support to kmod modprobe

Michael Jeanson mjeanson at efficios.com
Fri Feb 12 16:31:48 EST 2016


Report success when loading a module that is builtin the kernel.

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 src/bin/lttng-sessiond/modprobe.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/bin/lttng-sessiond/modprobe.c b/src/bin/lttng-sessiond/modprobe.c
index 3e41f5c..ca0467e 100644
--- a/src/bin/lttng-sessiond/modprobe.c
+++ b/src/bin/lttng-sessiond/modprobe.c
@@ -180,9 +180,12 @@ static int modprobe_lttng(struct kern_modules_param *modules,
 			goto error;
 		}
 
-		ret = kmod_module_probe_insert_module(mod, KMOD_PROBE_IGNORE_LOADED,
+		ret = kmod_module_probe_insert_module(mod, 0,
 				NULL, NULL, NULL, NULL);
-		if (ret < 0) {
+		if (ret == -EEXIST) {
+			DBG("Module %s is already loaded", modules[i].name);
+			ret = 0;
+		} else if (ret < 0) {
 			if (required) {
 				ERR("Unable to load required module %s",
 						modules[i].name);
-- 
2.7.0




More information about the lttng-dev mailing list