From 0b1e16b80fae6103cce51a647cff0edb9786f5b6 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 12 Feb 2016 16:31:48 -0500 Subject: [PATCH] Add builtin modules support to kmod modprobe MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Report success when loading a module that is built in the kernel. Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- 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 3e41f5c1b..ca0467eb3 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.34.1