Drop optional control modules load and unload
[lttng-tools.git] / src / bin / lttng-sessiond / modprobe.c
index a9035dab5766d167d1f0646befb4569f0de05974..81ce8105a220be9568618ac07ceb032811432127 100644 (file)
@@ -16,7 +16,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#define _GNU_SOURCE
 #define _LGPL_SOURCE
 #include <assert.h>
 #include <stdio.h>
@@ -34,8 +33,6 @@
 
 /* LTTng kernel tracer mandatory core modules list */
 struct kern_modules_param kern_modules_control_core[] = {
-       { "lttng-tracer" },     /* MUST be loaded first so keep at top */
-       { "lttng-lib-ring-buffer" },
        { "lttng-ring-buffer-client-discard" },
        { "lttng-ring-buffer-client-overwrite" },
        { "lttng-ring-buffer-metadata-client" },
@@ -44,14 +41,6 @@ struct kern_modules_param kern_modules_control_core[] = {
        { "lttng-ring-buffer-metadata-mmap-client" },
 };
 
-/* LTTng kernel tracer optional base modules list */
-struct kern_modules_param kern_modules_control_opt[] = {
-       { "lttng-types" },
-       { "lttng-ftrace" },
-       { "lttng-kprobes" },
-       { "lttng-kretprobes" },
-};
-
 /* LTTng kernel tracer probe modules list */
 struct kern_modules_param kern_modules_probes_default[] = {
        { "lttng-probe-asoc" },
@@ -92,6 +81,8 @@ struct kern_modules_param kern_modules_probes_default[] = {
        { "lttng-probe-v4l2" },
        { "lttng-probe-workqueue" },
        { "lttng-probe-writeback" },
+       { "lttng-probe-x86-irq-vectors" },
+       { "lttng-probe-x86-exceptions" },
 };
 
 /* dynamic probe modules list */
@@ -133,9 +124,6 @@ static void modprobe_remove_lttng(const struct kern_modules_param *modules,
  */
 void modprobe_remove_lttng_control(void)
 {
-       modprobe_remove_lttng(kern_modules_control_opt,
-                             ARRAY_SIZE(kern_modules_control_opt),
-                             LTTNG_MOD_OPTIONAL);
        modprobe_remove_lttng(kern_modules_control_core,
                              ARRAY_SIZE(kern_modules_control_core),
                              LTTNG_MOD_REQUIRED);
@@ -302,11 +290,6 @@ int modprobe_lttng_control(void)
        ret = modprobe_lttng(kern_modules_control_core,
                             ARRAY_SIZE(kern_modules_control_core),
                             LTTNG_MOD_REQUIRED);
-       if (ret != 0)
-               return ret;
-       ret = modprobe_lttng(kern_modules_control_opt,
-                            ARRAY_SIZE(kern_modules_control_opt),
-                            LTTNG_MOD_OPTIONAL);
        return ret;
 }
 
@@ -359,12 +342,12 @@ static int grow_probes(void)
 static int append_list_to_probes(const char *list)
 {
        char *next;
-       int index = nr_probes, ret;
-       char *tmp_list;
+       int ret;
+       char *tmp_list, *cur_list;
 
        assert(list);
 
-       tmp_list = strdup(list);
+       cur_list = tmp_list = strdup(list);
        if (!tmp_list) {
                PERROR("strdup temp list");
                return -ENOMEM;
@@ -374,11 +357,11 @@ static int append_list_to_probes(const char *list)
                size_t name_len;
                struct kern_modules_param *cur_mod;
 
-               next = strtok(tmp_list, ",");
+               next = strtok(cur_list, ",");
                if (!next) {
                        break;
                }
-               tmp_list = NULL;
+               cur_list = NULL;
 
                /* filter leading spaces */
                while (*next == ' ') {
@@ -395,7 +378,7 @@ static int append_list_to_probes(const char *list)
                /* Length 13 is "lttng-probe-" + \0 */
                name_len = strlen(next) + 13;
 
-               cur_mod = &probes[index];
+               cur_mod = &probes[nr_probes];
                cur_mod->name = zmalloc(name_len);
                if (!cur_mod->name) {
                        PERROR("malloc probe list");
@@ -410,7 +393,6 @@ static int append_list_to_probes(const char *list)
                        goto error;
                }
 
-               cur_mod++;
                nr_probes++;
        }
 
This page took 0.025122 seconds and 4 git commands to generate.