Add new API call lttng_channel_set_default_attr
[lttng-tools.git] / lttng / commands / disable_events.c
index b4d5ecb040d92894d9ab189cdeccff8d18c84afd..13ebd6c3acff763b235bfc4748fab0404716c81c 100644 (file)
 
 static char *opt_event_list;
 static char *opt_kernel;
-static char *opt_cmd_name;
 static char *opt_channel_name;
 static char *opt_session_name;
 static int opt_pid_all;
 static int opt_userspace;
+static char *opt_cmd_name;
 static int opt_disable_all;
 static pid_t opt_pid;
 
@@ -53,7 +53,7 @@ static struct poptOption long_options[] = {
        {"all-events",     'a', POPT_ARG_VAL, &opt_disable_all, 1, 0, 0},
        {"channel",        'c', POPT_ARG_STRING, &opt_channel_name, 0, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
-       {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, 0, OPT_USERSPACE, 0, 0},
+       {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
        {"all",            0,   POPT_ARG_VAL, &opt_pid_all, 1, 0, 0},
        {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
        {0, 0, 0, 0, 0, 0, 0}
@@ -86,7 +86,6 @@ static int disable_events(char *session_name)
 {
        int err, ret = CMD_SUCCESS;
        char *event_name, *channel_name = NULL;
-       struct lttng_event ev;
        struct lttng_domain dom;
 
        if (opt_channel_name == NULL) {
@@ -126,9 +125,6 @@ static int disable_events(char *session_name)
                        DBG("Disabling kernel event %s for channel %s",
                                        event_name, channel_name);
 
-                       /* Copy name and type of the event */
-                       strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
-                       ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
                        ret = lttng_disable_event(handle, event_name, channel_name);
                        if (ret < 0) {
                                MSG("Unable to disable event %s for channel %s",
@@ -186,7 +182,6 @@ int cmd_disable_events(int argc, const char **argv)
                        goto end;
                case OPT_USERSPACE:
                        opt_userspace = 1;
-                       opt_cmd_name = poptGetOptArg(pc);
                        break;
                default:
                        usage(stderr);
This page took 0.023609 seconds and 4 git commands to generate.