X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmodprobe.c;h=f701ca5f892b684063ec1e834af807a02ae8a4cd;hp=2f6d585d536c8d8b86f679eaa77ecdfc97ba6a6a;hb=412d7227e69ec845e44c49082a417f9454d9b55d;hpb=87a15032bae3edd0f8c8c2767acee7741bb79ad6 diff --git a/src/bin/lttng-sessiond/modprobe.c b/src/bin/lttng-sessiond/modprobe.c index 2f6d585d5..f701ca5f8 100644 --- a/src/bin/lttng-sessiond/modprobe.c +++ b/src/bin/lttng-sessiond/modprobe.c @@ -56,6 +56,14 @@ struct kern_modules_param kern_modules_control_core[] = { .name = (char *) "lttng-ring-buffer-event_notifier-client", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, }, + { + .name = (char *) "lttng-counter-client-percpu-64-modular", + .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + }, + { + .name = (char *) "lttng-counter-client-percpu-32-modular", + .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + }, }; /* LTTng kerneltracer probe modules list */ @@ -506,14 +514,23 @@ static void modprobe_remove_lttng(const struct kern_modules_param *modules, modprobe[sizeof(modprobe) - 1] = '\0'; ret = system(modprobe); if (ret == -1) { - ERR("Unable to launch modprobe -r for module %s", - modules[i].name); - } else if (modules[i].load_policy == KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED && WEXITSTATUS(ret) != 0) { - ERR("Unable to remove module %s", - modules[i].name); + if (modules[i].load_policy == KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED) { + ERR("Unable to launch modprobe -r for required module %s", + modules[i].name); + } else { + DBG("Unable to launch modprobe -r for optional module %s", + modules[i].name); + } + } else if (WEXITSTATUS(ret) != 0) { + if (modules[i].load_policy == KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED) { + ERR("Unable to remove required module %s", + modules[i].name); + } else { + DBG("Unable to remove optional module %s", + modules[i].name); + } } else { - DBG("Modprobe removal successful %s", - modules[i].name); + DBG("Modprobe removal successful %s", modules[i].name); } } } @@ -625,7 +642,7 @@ static int append_list_to_probes(const char *list) { char *next; int ret; - char *tmp_list, *cur_list; + char *tmp_list, *cur_list, *saveptr; assert(list); @@ -639,7 +656,7 @@ static int append_list_to_probes(const char *list) size_t name_len; struct kern_modules_param *cur_mod; - next = strtok(cur_list, ","); + next = strtok_r(cur_list, ",", &saveptr); if (!next) { break; } @@ -701,7 +718,7 @@ int modprobe_lttng_data(void) * Base probes: either from command line option, environment * variable or default list. */ - list = config.kmod_probes_list.value; + list = the_config.kmod_probes_list.value; if (list) { /* User-specified probes. */ ret = append_list_to_probes(list); @@ -737,7 +754,7 @@ int modprobe_lttng_data(void) /* * Extra modules? Append them to current probes list. */ - list = config.kmod_extra_probes_list.value; + list = the_config.kmod_extra_probes_list.value; if (list) { ret = append_list_to_probes(list); if (ret) {