SoW-2020-0003: Trace Hit Counters
[lttng-tools.git] / src / bin / lttng-sessiond / modprobe.c
index e1f52afd972b48aab29df0a6ac9a9d33f7b47c19..8d162857f6ae88eeec547857d96baf055db99b63 100644 (file)
@@ -52,6 +52,18 @@ struct kern_modules_param kern_modules_control_core[] = {
                .name = (char *) "lttng-ring-buffer-metadata-mmap-client",
                .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED,
        },
+       {
+               .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 */
@@ -502,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);
                }
        }
 }
@@ -621,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);
 
@@ -635,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;
                }
This page took 0.026293 seconds and 5 git commands to generate.