Actions
Bug #458
closedlttng create with just -C or -D (but not both) creates an incomplete session
Start date:
02/20/2013
Due date:
% Done:
0%
Estimated time:
Description
$ sudo -H lttng create sessionz -C net://131.132.32.77 Session sessionz created. Error: You need both control and data URL. Error: Command error $ sudo -H lttng list Available tracing sessions: 1) sessionz () [inactive] Use lttng list <session_name> for more details $ sudo -H lttng list sessionz Tracing session sessionz: [inactive] Trace path: $ sudo -H lttng start Error: Can't find valid lttng config /root/.lttngrc Did you create a session? (lttng create <my_session>) Error: Command error $ sudo -H lttng destroy sessionz Session sessionz destroyed
This is because create.c
's create_session
calls _lttng_create_session_ext
before checking if "was just one of -C and -D specified?":
if (opt_no_consumer) { [...] } else if (opt_output_path != NULL) { [...] } else if (opt_url) { /* Handling URL (-U opt) */ [...] } else if (opt_ctrl_url == NULL && opt_data_url == NULL) { [...] } ret = _lttng_create_session_ext(session_name, url, datetime); if (ret < 0) { [...] } MSG("Session %s created.", session_name); if (print_str_url) { MSG("Traces will be written in %s", print_str_url); } if (opt_ctrl_url && opt_data_url) { [...] } 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; }
That little block of code needs to be moved to the else if
that precedes _lttng_create_session_ext
.
Actions