projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mi version command: add commit version to mi version
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
create.c
diff --git
a/src/bin/lttng/commands/create.c
b/src/bin/lttng/commands/create.c
index a5f92f14a31c37ddddce57a925f4f2772cf3e38d..c43ce59b906c7a5f43db8e5fed1f709262951ac6 100644
(file)
--- a/
src/bin/lttng/commands/create.c
+++ b/
src/bin/lttng/commands/create.c
@@
-291,6
+291,12
@@
static int create_session(void)
}
}
}
}
+ if ((!opt_ctrl_url && opt_data_url) || (opt_ctrl_url && !opt_data_url)) {
+ ERR("You need both control and data URL.");
+ ret = CMD_ERROR;
+ goto error;
+ }
+
if (opt_output_path != NULL) {
traces_path = utils_expand_path(opt_output_path);
if (traces_path == NULL) {
if (opt_output_path != NULL) {
traces_path = utils_expand_path(opt_output_path);
if (traces_path == NULL) {
@@
-311,6
+317,12
@@
static int create_session(void)
} else if (opt_url) { /* Handling URL (-U opt) */
url = opt_url;
print_str_url = url;
} else if (opt_url) { /* Handling URL (-U opt) */
url = opt_url;
print_str_url = url;
+ } else if (opt_data_url && opt_ctrl_url) {
+ /*
+ * With both control and data, we'll be setting the consumer URL after
+ * session creation thus use no URL.
+ */
+ url = NULL;
} else if (!opt_no_output) {
/* Auto output path */
alloc_path = utils_get_home_dir();
} else if (!opt_no_output) {
/* Auto output path */
alloc_path = utils_get_home_dir();
@@
-332,22
+344,14
@@
static int create_session(void)
}
url = alloc_url;
}
url = alloc_url;
- if (!opt_data_url && !opt_ctrl_url) {
- print_str_url = alloc_url + strlen("file://");
- }
+ print_str_url = alloc_url + strlen("file://");
} else {
/* No output means --no-output or --snapshot mode. */
url = NULL;
}
} else {
/* No output means --no-output or --snapshot mode. */
url = NULL;
}
- if ((!opt_ctrl_url && opt_data_url) || (opt_ctrl_url && !opt_data_url)) {
- ERR("You need both control and data URL.");
- ret = CMD_ERROR;
- goto error;
- }
-
+ /* Use default live URL if NO url is/are found. */
if ((opt_live_timer && !opt_url) && (opt_live_timer && !opt_data_url)) {
if ((opt_live_timer && !opt_url) && (opt_live_timer && !opt_data_url)) {
- /* Use default live URL if none is found. */
ret = asprintf(&alloc_url, "net://127.0.0.1");
if (ret < 0) {
PERROR("asprintf default live URL");
ret = asprintf(&alloc_url, "net://127.0.0.1");
if (ret < 0) {
PERROR("asprintf default live URL");
@@
-383,7
+387,8
@@
static int create_session(void)
} else {
pathname = INSTALL_BIN_PATH "/lttng-relayd";
}
} else {
pathname = INSTALL_BIN_PATH "/lttng-relayd";
}
- if (!check_relayd() && spawn_relayd(pathname, 0) < 0) {
+ if (!opt_url && !opt_data_url && !check_relayd() &&
+ spawn_relayd(pathname, 0) < 0) {
goto error;
}
ret = lttng_create_session_live(session_name, url, opt_live_timer);
goto error;
}
ret = lttng_create_session_live(session_name, url, opt_live_timer);
@@
-510,6
+515,13
@@
int cmd_create(int argc, const char **argv)
}
}
}
}
+ /* TODO: mi support */
+ if (lttng_opt_mi) {
+ ret = -LTTNG_ERR_MI_NOT_IMPLEMENTED;
+ ERR("mi option not supported");
+ goto end;
+ }
+
if (opt_no_consumer) {
MSG("The option --no-consumer is obsolete. Use --no-output now.");
ret = CMD_WARNING;
if (opt_no_consumer) {
MSG("The option --no-consumer is obsolete. Use --no-output now.");
ret = CMD_WARNING;
This page took
0.025259 seconds
and
4
git commands to generate.