/* command line options */
char *opt_output_path;
static int opt_daemon, opt_background;
+int opt_group_output_by_session;
+int opt_group_output_by_host;
/*
* We need to wait for listener and live listener threads, as well as
{ "verbose", 0, 0, 'v', },
{ "config", 1, 0, 'f' },
{ "version", 0, 0, 'V' },
+ { "group-output-by-session", 0, 0, 's', },
+ { "group-output-by-host", 0, 0, 'p', },
{ NULL, 0, 0, 0, },
};
}
}
break;
+ case 's':
+ if (opt_group_output_by_host) {
+ ERR("Cannot set --group-output-by-session, --group-output-by-host already defined");
+ exit(EXIT_FAILURE);
+ }
+ opt_group_output_by_session = 1;
+ break;
+ case 'p':
+ if (opt_group_output_by_session) {
+ ERR("Cannot set --group-output-by-host, --group-output-by-session already defined");
+ exit(EXIT_FAILURE);
+ }
+ opt_group_output_by_host = 1;
+ break;
default:
/* Unknown option or other error.
* Error is printed by getopt, just return */
}
}
+ if (!opt_group_output_by_session && !opt_group_output_by_host) {
+ /* Group by host by default */
+ opt_group_output_by_host = 1;
+ }
+
exit:
free(optstring);
return retval;
if (session->minor == 1) {
/* For 2.1 */
ret = cmd_recv_stream_2_1(payload, &path_name,
- &channel_name);
+ &channel_name, session);
} else if (session->minor > 1 && session->minor < 11) {
/* From 2.2 to 2.10 */
ret = cmd_recv_stream_2_2(payload, &path_name,
- &channel_name, &tracefile_size, &tracefile_count);
+ &channel_name, &tracefile_size, &tracefile_count,
+ session);
} else {
/* From 2.11 to ... */
ret = cmd_recv_stream_2_11(payload, &path_name,
&channel_name, &tracefile_size, &tracefile_count,
- &stream_chunk_id.value);
+ &stream_chunk_id.value, session);
stream_chunk_id.is_set = true;
}
* change).
*/
free(stream->path_name);
- stream->path_name = create_output_path(new_path_view.data);
+ stream->path_name = create_output_path(new_path_view.data, session->session_name);
if (!stream->path_name) {
ERR("Failed to create a new output path");
ret = -1;
path_view = lttng_buffer_view_from_view(payload, header_len,
path_info_header.length);
- path = create_output_path(path_view.data);
+ path = create_output_path(path_view.data, session->session_name);
if (!path) {
ERR("Failed to create output path");
ret = -1;
goto end;
}
- complete_old_path = create_output_path(old_path_view.data);
+ complete_old_path = create_output_path(old_path_view.data, session->session_name);
if (!complete_old_path) {
ERR("Failed to build old output path in rotate_rename command");
ret = -1;
goto end;
}
- complete_new_path = create_output_path(new_path_view.data);
+ complete_new_path = create_output_path(new_path_view.data, session->session_name);
if (!complete_new_path) {
ERR("Failed to build new output path in rotate_rename command");
ret = -1;