goto end;
}
- ret = asprintf(&chunk_path, "%s/" DEFAULT_ARCHIVED_TRACE_CHUNKS_DIRECTORY "/%s",
- session_get_base_path(session),
- session->last_archived_chunk_name);
- if (ret == -1) {
- goto end;
- }
-
switch (session_get_consumer_destination_type(session)) {
case CONSUMER_DST_LOCAL:
+ ret = asprintf(&chunk_path,
+ "%s/" DEFAULT_ARCHIVED_TRACE_CHUNKS_DIRECTORY "/%s",
+ session_get_base_path(session),
+ session->last_archived_chunk_name);
+ if (ret == -1) {
+ goto end;
+ }
location = lttng_trace_archive_location_local_create(
chunk_path);
break;
location = lttng_trace_archive_location_relay_create(
hostname,
LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP,
- control_port, data_port, chunk_path);
+ control_port, data_port, session->last_chunk_path);
break;
}
default:
goto end_no_move;
}
-bool session_output_supports_trace_chunks(const struct ltt_session *session)
-{
- const struct consumer_output *output = session->kernel_session ?
- session->kernel_session->consumer :
- session->ust_session->consumer;
-
- if (output->type == CONSUMER_DST_LOCAL) {
- return true;
- } else {
- if (output->relay_major_version > 2) {
- return true;
- } else if (output->relay_major_version == 2 &&
- output->relay_minor_version >= 11) {
- return true;
- }
- }
- return false;
-}
-
struct lttng_trace_chunk *session_create_new_trace_chunk(
const struct ltt_session *session,
const struct consumer_output *consumer_output_override,
int session_close_trace_chunk(const struct ltt_session *session,
struct lttng_trace_chunk *trace_chunk,
- const enum lttng_trace_chunk_command_type *close_command)
+ const enum lttng_trace_chunk_command_type *close_command,
+ char *closed_trace_chunk_path)
{
int ret = 0;
bool error_occurred = false;
ret = consumer_close_trace_chunk(socket,
relayd_id,
session->id,
- trace_chunk);
+ trace_chunk, closed_trace_chunk_path);
pthread_mutex_unlock(socket->lock);
if (ret) {
ERR("Failed to close trace chunk on user space consumer");
ret = consumer_close_trace_chunk(socket,
relayd_id,
session->id,
- trace_chunk);
+ trace_chunk, closed_trace_chunk_path);
pthread_mutex_unlock(socket->lock);
if (ret) {
ERR("Failed to close trace chunk on kernel consumer");
DEFAULT_SESSION_NAME, i,
datetime);
}
+ new_session->name_contains_creation_time = true;
if (ret == -1 || ret >= sizeof(new_session->name)) {
/*
* Null-terminate in case the name is used