X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=d3e5b9a84106f84fbde44c50eb8376bcd8faae94;hp=60ca1f5d45fc7e0b6271f022b382d9ff8ce9a162;hb=a8d119b5ea8e40cde5f5e70c1ae4cfc86cb35a80;hpb=c72196171a55e7cabeebe19d68352452e2bf6b25 diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index 60ca1f5d4..d3e5b9a84 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -442,7 +442,7 @@ static int create_session(void) MSG("Traces will be written in %s", print_str_url); if (opt_live_timer) { - MSG("Live timer set to %u usec", opt_live_timer); + MSG("Live timer set to %u %s", opt_live_timer, USEC_UNIT); } } else if (opt_snapshot) { if (print_str_url) { @@ -616,6 +616,22 @@ end: return ret; } +int validate_url_option_combination(void) +{ + int ret = 0; + int used_count = 0; + + used_count += !!opt_url; + used_count += !!opt_output_path; + used_count += (opt_data_url || opt_ctrl_url); + if (used_count > 1) { + ERR("Only one of the --set-url, --ctrl-url/data-url, or --output options may be used at once."); + ret = -1; + } + + return ret; +} + /* * The 'create ' first level command * @@ -687,6 +703,12 @@ int cmd_create(int argc, const char **argv) goto end; } + ret = validate_url_option_combination(); + if (ret) { + ret = CMD_ERROR; + goto end; + } + /* Spawn a session daemon if needed */ if (!opt_no_sessiond) { ret = launch_sessiond();