projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lttng enable-events: fix argument parsing
[lttng-tools.git]
/
lttng
/
commands
/
enable_channels.c
diff --git
a/lttng/commands/enable_channels.c
b/lttng/commands/enable_channels.c
index d8ad2a77b67a548df98ac10c6077e5f46481642e..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;
@@
-118,7
+119,13
@@
static int enable_channel(char *session_name)
dom.type = LTTNG_DOMAIN_UST_PID;
dom.attr.pid = opt_pid;
DBG("PID %d set to lttng handle", opt_pid);
dom.type = LTTNG_DOMAIN_UST_PID;
dom.attr.pid = opt_pid;
DBG("PID %d set to lttng handle", opt_pid);
+ } else if (opt_userspace && opt_cmd_name == NULL) {
+ dom.type = LTTNG_DOMAIN_UST;
+ } else if (opt_userspace && opt_cmd_name != NULL) {
+ dom.type = LTTNG_DOMAIN_UST_EXEC_NAME;
+ strncpy(dom.attr.exec_name, opt_cmd_name, NAME_MAX);
} else {
} else {
+ ERR("Please specify a tracer (--kernel or --userspace)");
ret = CMD_NOT_IMPLEMENTED;
goto error;
}
ret = CMD_NOT_IMPLEMENTED;
goto error;
}
@@
-127,9
+134,6
@@
static int enable_channel(char *session_name)
if (handle == NULL) {
ret = -1;
goto error;
if (handle == NULL) {
ret = -1;
goto error;
- } else {
- ERR("Please specify a tracer (--kernel or --userspace)");
- goto error;
}
/* Strip channel list (format: chan1,chan2,...) */
}
/* Strip channel list (format: chan1,chan2,...) */
@@
-179,8
+183,8
@@
static void init_channel_config(void)
chan.attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
chan.attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
chan.attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
chan.attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
- chan.attr.subbuf_size = DEFAULT_CHANNEL_SUBBUF_SIZE;
- chan.attr.num_subbuf = DEFAULT_CHANNEL_SUBBUF_NUM;
+ chan.attr.subbuf_size = DEFAULT_
UST_
CHANNEL_SUBBUF_SIZE;
+ chan.attr.num_subbuf = DEFAULT_
UST_
CHANNEL_SUBBUF_NUM;
chan.attr.output = DEFAULT_CHANNEL_OUTPUT;
}
}
chan.attr.output = DEFAULT_CHANNEL_OUTPUT;
}
}
@@
-205,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");
@@
-233,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;
This page took
0.025095 seconds
and
4
git commands to generate.