X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=d66f0309e28de3613468fdd4f3ba06d4ccf51040;hp=08b12a46eee2b95e6093f738a97a5b0f01936551;hb=0ab619061fcf5f38193da3b2839c7d0963b61ac9;hpb=0a340972f05818a6c6c83bcc53d7481ee6f07d22 diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index 08b12a46e..d66f0309e 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -112,7 +112,7 @@ static void usage(FILE *ofp) fprintf(ofp, " TCP for both control (PORT1) and data port (PORT2).\n"); fprintf(ofp, " The default ports are respectively 5342 and 5343.\n"); fprintf(ofp, "\n"); - fprintf(ofp, " > tcp[4|6]://...\n"); + fprintf(ofp, " > tcp[6]://...\n"); fprintf(ofp, " Can only be used with -C and -D together\n"); fprintf(ofp, "\n"); fprintf(ofp, "NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732)\n"); @@ -350,9 +350,11 @@ static int create_session(void) } MSG("Session %s created.", session_name); - MSG("Traces will be written in %s", print_str_url); + if (print_str_url) { + MSG("Traces will be written in %s", print_str_url); + } - if (opt_ctrl_url || opt_data_url) { + if (opt_ctrl_url && opt_data_url) { /* Setting up control URI (-C or/and -D opt) */ ret = set_consumer_url(session_name, opt_ctrl_url, opt_data_url); if (ret < 0) { @@ -363,6 +365,11 @@ static int create_session(void) if (ret < 0) { goto error; } + } else 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_disable_consumer && !opt_no_consumer) {