projects
/
lttng-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
509cbaf
)
lttng UI: read opt_cmd_name opt arg for each command
author
Mathieu Desnoyers
<mathieu.desnoyers@efficios.com>
Sun, 13 Nov 2011 17:12:12 +0000
(12:12 -0500)
committer
Mathieu Desnoyers
<mathieu.desnoyers@efficios.com>
Sun, 13 Nov 2011 17:12:12 +0000
(12:12 -0500)
Ensure all commands are layed out in the same way too.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng/commands/add_context.c
patch
|
blob
|
blame
|
history
lttng/commands/calibrate.c
patch
|
blob
|
blame
|
history
lttng/commands/disable_channels.c
patch
|
blob
|
blame
|
history
lttng/commands/disable_events.c
patch
|
blob
|
blame
|
history
lttng/commands/enable_channels.c
patch
|
blob
|
blame
|
history
lttng/commands/enable_events.c
patch
|
blob
|
blame
|
history
lttng/commands/list.c
patch
|
blob
|
blame
|
history
diff --git
a/lttng/commands/add_context.c
b/lttng/commands/add_context.c
index e82678bfccd08054fee3a1f82dd330f45d9db0f6..dd13d223be9e5aac96aab78cc1ba9a5889803995 100644
(file)
--- a/
lttng/commands/add_context.c
+++ b/
lttng/commands/add_context.c
@@
-40,11
+40,13
@@
static char *opt_session_name;
static int *opt_kernel;
static int opt_pid_all;
static int opt_userspace;
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,
static pid_t opt_pid;
enum {
OPT_HELP = 1,
OPT_TYPE,
+ OPT_USERSPACE,
};
static struct lttng_handle *handle;
};
static struct lttng_handle *handle;
@@
-138,7
+140,7
@@
static struct poptOption long_options[] = {
{"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},
{"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},
{"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},
@@
-461,6
+463,10
@@
int cmd_add_context(int argc, const char **argv)
}
free(tmp);
break;
}
free(tmp);
break;
+ case OPT_USERSPACE:
+ opt_userspace = 1;
+ opt_cmd_name = poptGetOptArg(pc);
+ break;
default:
usage(stderr);
ret = CMD_UNDEFINED;
default:
usage(stderr);
ret = CMD_UNDEFINED;
diff --git
a/lttng/commands/calibrate.c
b/lttng/commands/calibrate.c
index e17a2fd73b12b82f11363f1150edc89f1a7a27fe..6979ef6eaa0c765852b938abd779d2c1edbe2397 100644
(file)
--- a/
lttng/commands/calibrate.c
+++ b/
lttng/commands/calibrate.c
@@
-34,20
+34,20
@@
static int opt_event_type;
static char *opt_kernel;
static int opt_event_type;
static char *opt_kernel;
-static char *opt_cmd_name;
static int opt_pid_all;
static int opt_userspace;
static int opt_pid_all;
static int opt_userspace;
+static char *opt_cmd_name;
static pid_t opt_pid;
enum {
OPT_HELP = 1,
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_TRACEPOINT,
OPT_MARKER,
OPT_PROBE,
OPT_FUNCTION,
OPT_FUNCTION_ENTRY,
OPT_SYSCALL,
+ OPT_USERSPACE,
};
static struct lttng_handle *handle;
};
static struct lttng_handle *handle;
@@
-181,10
+181,6
@@
int cmd_calibrate(int argc, const char **argv)
usage(stderr);
ret = CMD_SUCCESS;
goto end;
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_TRACEPOINT:
ret = CMD_NOT_IMPLEMENTED;
break;
@@
-203,6
+199,10
@@
int cmd_calibrate(int argc, const char **argv)
case OPT_SYSCALL:
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;
default:
usage(stderr);
ret = CMD_UNDEFINED;
diff --git
a/lttng/commands/disable_channels.c
b/lttng/commands/disable_channels.c
index 9a816e3efb0bc652663492d224d038dc05dba253..262165eb3f0162f09580b83f9913f621df10c10f 100644
(file)
--- a/
lttng/commands/disable_channels.c
+++ b/
lttng/commands/disable_channels.c
@@
-34,6
+34,7
@@
static char *opt_kernel;
static char *opt_session_name;
static int opt_pid_all;
static int opt_userspace;
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 {
static pid_t opt_pid;
enum {
@@
-48,7
+49,7
@@
static struct poptOption long_options[] = {
{"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},
{"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}
{"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}
@@
-147,6
+148,7
@@
int cmd_disable_channels(int argc, const char **argv)
goto end;
case OPT_USERSPACE:
opt_userspace = 1;
goto end;
case OPT_USERSPACE:
opt_userspace = 1;
+ opt_cmd_name = poptGetOptArg(pc);
break;
default:
usage(stderr);
break;
default:
usage(stderr);
diff --git
a/lttng/commands/disable_events.c
b/lttng/commands/disable_events.c
index f30a2b28ac4ea629f7ea0266b6574b3d4e90630a..09b61cbe25da6f55bb4bed2751bc9befec57bad3 100644
(file)
--- 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_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_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 int opt_disable_all;
static pid_t opt_pid;
diff --git
a/lttng/commands/enable_channels.c
b/lttng/commands/enable_channels.c
index 715552b5b706a811a853028cfa9953db31e6c9b8..aac5fa4979c9d274b62f72ee61bcdd67c311dd9b 100644
(file)
--- a/
lttng/commands/enable_channels.c
+++ b/
lttng/commands/enable_channels.c
@@
-36,6
+36,7
@@
static char *opt_cmd_name;
static char *opt_session_name;
static int opt_pid_all;
static int opt_userspace;
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;
static pid_t opt_pid;
static struct lttng_channel chan;
@@
-208,10
+209,6
@@
int cmd_enable_channels(int argc, const char **argv)
usage(stderr);
ret = CMD_SUCCESS;
goto end;
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");
case OPT_DISCARD:
chan.attr.overwrite = 0;
DBG("Channel set to discard");
@@
-236,6
+233,10
@@
int cmd_enable_channels(int argc, const char **argv)
chan.attr.read_timer_interval = atoi(poptGetOptArg(pc));
DBG("Channel read timer interval set to %d", chan.attr.read_timer_interval);
break;
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;
default:
usage(stderr);
ret = CMD_UNDEFINED;
diff --git
a/lttng/commands/enable_events.c
b/lttng/commands/enable_events.c
index cb53fb0db96094c9736ae181e3bcc3ce27fcd0a9..3bf50fbeaf5c779b58233af5b4bbf4785ac60374 100644
(file)
--- a/
lttng/commands/enable_events.c
+++ b/
lttng/commands/enable_events.c
@@
-34,10
+34,10
@@
static char *opt_event_list;
static int opt_event_type;
static char *opt_kernel;
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_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;
static int opt_enable_all;
static pid_t opt_pid;
static char *opt_probe;
@@
-47,13
+47,13
@@
static char *opt_channel_name;
enum {
OPT_HELP = 1,
enum {
OPT_HELP = 1,
- OPT_USERSPACE,
OPT_TRACEPOINT,
OPT_MARKER,
OPT_PROBE,
OPT_FUNCTION,
OPT_FUNCTION_ENTRY,
OPT_SYSCALL,
OPT_TRACEPOINT,
OPT_MARKER,
OPT_PROBE,
OPT_FUNCTION,
OPT_FUNCTION_ENTRY,
OPT_SYSCALL,
+ OPT_USERSPACE,
};
static struct lttng_handle *handle;
};
static struct lttng_handle *handle;
@@
-388,15
+388,12
@@
int cmd_enable_events(int argc, const char **argv)
opt_event_type = LTTNG_EVENT_ALL;
while ((opt = poptGetNextOpt(pc)) != -1) {
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;
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_TRACEPOINT:
opt_event_type = LTTNG_EVENT_TRACEPOINT;
break;
@@
-418,6
+415,10
@@
int cmd_enable_events(int argc, const char **argv)
case OPT_SYSCALL:
opt_event_type = LTTNG_EVENT_SYSCALL;
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;
default:
usage(stderr);
ret = CMD_UNDEFINED;
diff --git
a/lttng/commands/list.c
b/lttng/commands/list.c
index 808c2a549edbe9519a3b90387fbff845547020bb..e2d5b6643d5df24f15d5a2bb658ae6460604c22e 100644
(file)
--- a/
lttng/commands/list.c
+++ b/
lttng/commands/list.c
@@
-28,6
+28,7
@@
static int opt_pid;
static int opt_userspace;
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;
static int opt_kernel;
static char *opt_channel;
static int opt_domain;
@@
-38,6
+39,7
@@
const char *indent8 = " ";
enum {
OPT_HELP = 1,
enum {
OPT_HELP = 1,
+ OPT_USERSPACE,
};
static struct lttng_handle *handle;
};
static struct lttng_handle *handle;
@@
-46,7
+48,7
@@
static struct poptOption long_options[] = {
/* 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},
/* 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},
{"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},
@@
-477,6
+479,10
@@
int cmd_list(int argc, const char **argv)
case OPT_HELP:
usage(stderr);
goto end;
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;
default:
usage(stderr);
ret = CMD_UNDEFINED;
This page took
0.030054 seconds
and
4
git commands to generate.