X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng%2Fcommands%2Fdisable_events.c;h=13ebd6c3acff763b235bfc4748fab0404716c81c;hb=95da129739398dae8f922a0f2f53ddc419c7682d;hp=b4d5ecb040d92894d9ab189cdeccff8d18c84afd;hpb=cd80958d00fddabced5fbd60641978516a01e29e;p=lttng-tools.git diff --git a/lttng/commands/disable_events.c b/lttng/commands/disable_events.c index b4d5ecb04..13ebd6c3a 100644 --- a/lttng/commands/disable_events.c +++ b/lttng/commands/disable_events.c @@ -31,11 +31,11 @@ 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);