enum lttng_viewer_seek seek_t)
{
struct relay_viewer_stream *vstream = NULL;
const bool acquired_reference = lttng_trace_chunk_get(
enum lttng_viewer_seek seek_t)
{
struct relay_viewer_stream *vstream = NULL;
const bool acquired_reference = lttng_trace_chunk_get(
vstream->path_name = lttng_strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
if (vstream->path_name == NULL) {
PERROR("relay viewer path_name alloc");
vstream->path_name = lttng_strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
if (vstream->path_name == NULL) {
PERROR("relay viewer path_name alloc");
/*
* We seek at the very end of each stream, awaiting for
* a future packet to eventually come in.
/*
* We seek at the very end of each stream, awaiting for
* a future packet to eventually come in.
} else {
const uint32_t connection_major = stream->trace->session->major;
const uint32_t connection_minor = stream->trace->session->minor;
} else {
const uint32_t connection_major = stream->trace->session->major;
const uint32_t connection_minor = stream->trace->session->minor;
- vstream->index_file = lttng_index_file_create_from_trace_chunk_read_only(
- stream->trace_chunk, stream->path_name,
+ chunk_status = lttng_index_file_create_from_trace_chunk_read_only(
+ vstream->stream_file.trace_chunk,
+ stream->path_name,
stream->channel_name, stream->tracefile_size,
vstream->current_tracefile_id,
lttng_to_index_major(connection_major,
connection_minor),
lttng_to_index_minor(connection_major,
stream->channel_name, stream->tracefile_size,
vstream->current_tracefile_id,
lttng_to_index_major(connection_major,
connection_minor),
lttng_to_index_minor(connection_major,
- connection_minor));
- if (!vstream->index_file) {
- goto error_unlock;
+ connection_minor),
+ true, &vstream->index_file);
+ if (chunk_status != LTTNG_TRACE_CHUNK_STATUS_OK) {
+ if (chunk_status == LTTNG_TRACE_CHUNK_STATUS_NO_FILE) {
+ vstream->index_file = NULL;
+ } else {
+ goto error_unlock;
+ }
/* Globally visible after the add unique. */
lttng_ht_node_init_u64(&vstream->stream_n, stream->stream_handle);
/* Globally visible after the add unique. */
lttng_ht_node_init_u64(&vstream->stream_n, stream->stream_handle);
const struct relay_stream *stream = vstream->stream;
const uint32_t connection_major = stream->trace->session->major;
const uint32_t connection_minor = stream->trace->session->minor;
const struct relay_stream *stream = vstream->stream;
const uint32_t connection_major = stream->trace->session->major;
const uint32_t connection_minor = stream->trace->session->minor;
- vstream->index_file =
- lttng_index_file_create_from_trace_chunk_read_only(
- stream->trace_chunk, stream->path_name,
+ chunk_status = lttng_index_file_create_from_trace_chunk_read_only(
+ vstream->stream_file.trace_chunk,
+ stream->path_name,
stream->channel_name,
stream->tracefile_size,
vstream->current_tracefile_id,
lttng_to_index_major(connection_major,
connection_minor),
lttng_to_index_minor(connection_major,
stream->channel_name,
stream->tracefile_size,
vstream->current_tracefile_id,
lttng_to_index_major(connection_major,
connection_minor),
lttng_to_index_minor(connection_major,