Ensure all commands are layed out in the same way too.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
static int *opt_kernel;
static int opt_pid_all;
static int opt_userspace;
+static char *opt_cmd_name;
static pid_t opt_pid;
enum {
OPT_HELP = 1,
OPT_TYPE,
+ OPT_USERSPACE,
};
static struct lttng_handle *handle;
{"channel", 'c', POPT_ARG_STRING, &opt_channel_name, 0, 0, 0},
{"event", 'e', POPT_ARG_STRING, &opt_event_name, 0, 0, 0},
{"kernel", 'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
- {"userspace", 'u', POPT_ARG_VAL, &opt_userspace, 1, 0, 0},
+ {"userspace", 'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, 0, 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},
{"type", 't', POPT_ARG_STRING, 0, OPT_TYPE, 0, 0},
}
free(tmp);
break;
+ case OPT_USERSPACE:
+ opt_userspace = 1;
+ opt_cmd_name = poptGetOptArg(pc);
+ break;
default:
usage(stderr);
ret = CMD_UNDEFINED;
static int opt_event_type;
static char *opt_kernel;
-static char *opt_cmd_name;
static int opt_pid_all;
static int opt_userspace;
+static char *opt_cmd_name;
static pid_t opt_pid;
enum {
OPT_HELP = 1,
- OPT_USERSPACE,
OPT_TRACEPOINT,
OPT_MARKER,
OPT_PROBE,
OPT_FUNCTION,
OPT_FUNCTION_ENTRY,
OPT_SYSCALL,
+ OPT_USERSPACE,
};
static struct lttng_handle *handle;
usage(stderr);
ret = CMD_SUCCESS;
goto end;
- case OPT_USERSPACE:
- opt_userspace = 1;
- opt_cmd_name = poptGetOptArg(pc);
- break;
case OPT_TRACEPOINT:
ret = CMD_NOT_IMPLEMENTED;
break;
case OPT_SYSCALL:
ret = CMD_NOT_IMPLEMENTED;
break;
+ case OPT_USERSPACE:
+ opt_userspace = 1;
+ opt_cmd_name = poptGetOptArg(pc);
+ break;
default:
usage(stderr);
ret = CMD_UNDEFINED;
static char *opt_session_name;
static int opt_pid_all;
static int opt_userspace;
+static char *opt_cmd_name;
static pid_t opt_pid;
enum {
{"help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0},
{"session", 's', POPT_ARG_STRING, &opt_session_name, 0, 0, 0},
{"kernel", 'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
- {"userspace", 'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
+ {"userspace", 'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, 0, 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}
goto end;
case OPT_USERSPACE:
opt_userspace = 1;
+ opt_cmd_name = poptGetOptArg(pc);
break;
default:
usage(stderr);
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;
static char *opt_session_name;
static int opt_pid_all;
static int opt_userspace;
+static char *opt_cmd_name;
static pid_t opt_pid;
static struct lttng_channel chan;
usage(stderr);
ret = CMD_SUCCESS;
goto end;
- case OPT_USERSPACE:
- opt_userspace = 1;
- opt_cmd_name = poptGetOptArg(pc);
- break;
case OPT_DISCARD:
chan.attr.overwrite = 0;
DBG("Channel set to discard");
chan.attr.read_timer_interval = atoi(poptGetOptArg(pc));
DBG("Channel read timer interval set to %d", chan.attr.read_timer_interval);
break;
+ case OPT_USERSPACE:
+ opt_userspace = 1;
+ opt_cmd_name = poptGetOptArg(pc);
+ break;
default:
usage(stderr);
ret = CMD_UNDEFINED;
static char *opt_event_list;
static int opt_event_type;
static char *opt_kernel;
-static char *opt_cmd_name;
static char *opt_session_name;
static int opt_pid_all;
static int opt_userspace;
+static char *opt_cmd_name;
static int opt_enable_all;
static pid_t opt_pid;
static char *opt_probe;
enum {
OPT_HELP = 1,
- OPT_USERSPACE,
OPT_TRACEPOINT,
OPT_MARKER,
OPT_PROBE,
OPT_FUNCTION,
OPT_FUNCTION_ENTRY,
OPT_SYSCALL,
+ OPT_USERSPACE,
};
static struct lttng_handle *handle;
opt_event_type = LTTNG_EVENT_ALL;
while ((opt = poptGetNextOpt(pc)) != -1) {
+ fprintf(stderr, "OPT TEST %d\n", opt);
switch (opt) {
case OPT_HELP:
usage(stderr);
ret = CMD_SUCCESS;
goto end;
- case OPT_USERSPACE:
- opt_userspace = 1;
- opt_cmd_name = poptGetOptArg(pc);
- break;
case OPT_TRACEPOINT:
opt_event_type = LTTNG_EVENT_TRACEPOINT;
break;
case OPT_SYSCALL:
opt_event_type = LTTNG_EVENT_SYSCALL;
break;
+ case OPT_USERSPACE:
+ opt_userspace = 1;
+ opt_cmd_name = poptGetOptArg(pc);
+ break;
default:
usage(stderr);
ret = CMD_UNDEFINED;
static int opt_pid;
static int opt_userspace;
+static char *opt_cmd_name;
static int opt_kernel;
static char *opt_channel;
static int opt_domain;
enum {
OPT_HELP = 1,
+ OPT_USERSPACE,
};
static struct lttng_handle *handle;
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
{"help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0},
{"kernel", 'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
- {"userspace", 'u', POPT_ARG_VAL, &opt_userspace, 1, 0, 0},
+ {"userspace", 'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, 0, OPT_USERSPACE, 0, 0},
{"pid", 'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
{"channel", 'c', POPT_ARG_STRING, &opt_channel, 0, 0, 0},
{"domain", 'd', POPT_ARG_VAL, &opt_domain, 1, 0, 0},
case OPT_HELP:
usage(stderr);
goto end;
+ case OPT_USERSPACE:
+ opt_userspace = 1;
+ opt_cmd_name = poptGetOptArg(pc);
+ break;
default:
usage(stderr);
ret = CMD_UNDEFINED;