Remove dead code from disable-event command
[lttng-tools.git] / src / bin / lttng / commands / disable_events.c
index 9ab8bf0b2972f244a4e9223105e7543b0c8025cf..c6ec85fb4453db56e2709c4f9eb7b8dced228c08 100644 (file)
@@ -40,11 +40,6 @@ static int opt_jul;
 static int opt_log4j;
 static int opt_python;
 static int opt_event_type;
-#if 0
-/* Not implemented yet */
-static char *opt_cmd_name;
-static pid_t opt_pid;
-#endif
 
 enum {
        OPT_HELP = 1,
@@ -67,13 +62,7 @@ static struct poptOption long_options[] = {
        {"python",         'p', POPT_ARG_VAL, &opt_python, 1, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
        {"syscall",        0,   POPT_ARG_NONE, 0, OPT_SYSCALL, 0, 0},
-#if 0
-       /* Not implemented yet */
-       {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
-       {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
-#else
        {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
-#endif
        {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL},
        {0, 0, 0, 0, 0, 0, 0}
 };
@@ -185,9 +174,8 @@ static int disable_events(char *session_name)
        } else if (opt_python) {
                dom.type = LTTNG_DOMAIN_PYTHON;
        } else {
-               print_missing_domain();
-               ret = CMD_ERROR;
-               goto error;
+               /* Checked by the caller. */
+               assert(0);
        }
 
        channel_name = opt_channel_name;
@@ -222,6 +210,9 @@ static int disable_events(char *session_name)
        }
 
        memset(&event, 0, sizeof(event));
+       /* Set default loglevel to any/unknown */
+       event.loglevel = -1;
+
        switch (opt_event_type) {
        case LTTNG_EVENT_SYSCALL:
                event.type = LTTNG_EVENT_SYSCALL;
@@ -374,6 +365,13 @@ int cmd_disable_events(int argc, const char **argv)
                }
        }
 
+       ret = print_missing_or_multiple_domains(
+               opt_kernel + opt_userspace + opt_jul + opt_log4j + opt_python);
+       if (ret) {
+               ret = CMD_ERROR;
+               goto end;
+       }
+
        opt_event_list = (char*) poptGetArg(pc);
        if (opt_event_list == NULL && opt_disable_all == 0) {
                ERR("Missing event name(s).\n");
This page took 0.023447 seconds and 4 git commands to generate.