X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmodprobe.cpp;h=0b274c9a3fae6e4986f4704c9bdc5e7c4ba221f7;hb=HEAD;hp=ac9f14257c6c5334a38be31e494d98fd6e619656;hpb=cd9adb8b829564212158943a0d279bb35322ab30;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/modprobe.cpp b/src/bin/lttng-sessiond/modprobe.cpp index ac9f14257..0b274c9a3 100644 --- a/src/bin/lttng-sessiond/modprobe.cpp +++ b/src/bin/lttng-sessiond/modprobe.cpp @@ -393,11 +393,11 @@ static int modprobe_lttng(struct kern_modules_param *modules, int entries) ret = 0; } else if (ret < 0) { if (modules[i].load_policy == KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED) { - ERR("Unable to load required module %s", modules[i].name); + PERROR("Unable to load required module `%s`", modules[i].name) goto error; } else { - DBG("Unable to load optional module %s; continuing", - modules[i].name); + PERROR("Unable to load optional module `%s`; continuing", + modules[i].name); ret = 0; } } else { @@ -491,7 +491,7 @@ static void modprobe_remove_lttng(const struct kern_modules_param *modules, int DBG("Module %s is not in kernel.", modules[i].name); } else if (modules[i].load_policy == KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED && ret < 0) { - ERR("Unable to remove module %s", modules[i].name); + PERROR("Unable to remove module `%s`", modules[i].name); } else { DBG("Modprobe removal successful %s", modules[i].name); } @@ -540,6 +540,10 @@ static int modprobe_lttng(struct kern_modules_param *modules, int entries) } else if (WEXITSTATUS(ret) != 0) { if (modules[i].load_policy == KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED) { ERR("Unable to load required module %s", modules[i].name); + /* Force negative return code */ + if (ret > 0) { + ret = -ret; + } goto error; } else { DBG("Unable to load optional module %s; continuing",