common: index and trace-chunk file creation/open API change
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 11 Dec 2019 18:19:13 +0000 (13:19 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Dec 2019 22:34:50 +0000 (17:34 -0500)
commit3ff5c5db220d92baf64280ba54713fcafe76142e
treebd6880291512adf45d010619715e7ebbe4053a78
parentcc280027af4d65437a30613bb63421ae8d7b199a
common: index and trace-chunk file creation/open API change

An API change to the common libraries is required for the following
functions to accomodate the clear feature:

- lttng_trace_chunk_open_file(),
- lttng_index_file_create_from_trace_chunk(),
- lttng_index_file_create_from_trace_chunk_read_only().

An "expect_no_file" boolean is introduced, allowing specific invocation
to consider a ENOENT errno as an expected condition (and not an error).
This is the case for instance for relayd live viewer_stream_rotate(),
which can fail to open files in the new chunk after a clear with per-pid
buffers. Same goes for viewer_get_next_index() and try_open_index().

Change the lttng_index_file_create_from_trace_chunk_read_only and
lttng_index_file_create_from_trace_chunk to allow them to return
a chunk status, which allows the callers to distinguish between
errors and a "no file" status, and deal with the situation accordingly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I3c43edca01629488c4e777078db7ffd2e88dc7ea
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/live.c
src/bin/lttng-relayd/stream.c
src/bin/lttng-relayd/viewer-stream.c
src/common/consumer/consumer-stream.c
src/common/index/index.c
src/common/index/index.h
src/common/trace-chunk.c
src/common/trace-chunk.h
This page took 0.02628 seconds and 4 git commands to generate.