pthread_cond_t metadata_rdv;
pthread_mutex_t metadata_rdv_lock;
+ /*
+ * Read-only copies of channel values. We cannot safely access the
+ * channel from a stream, so we need to have a local copy of these
+ * fields in the stream object. These fields should be removed from
+ * the stream objects when we introduce refcounting.
+ */
+ struct {
+ char path[LTTNG_PATH_MAX];
+ uint64_t tracefile_size;
+ } channel_read_only_attributes;
+
/* Indicate if the stream still has some data to be read. */
unsigned int has_data:1;
/*
*/
int lttng_consumer_poll_socket(struct pollfd *kconsumer_sockpoll);
+/*
+ * Copy the fields from the channel that need to be accessed (read-only)
+ * directly from the stream.
+ */
+void consumer_stream_update_channel_attributes(
+ struct lttng_consumer_stream *stream,
+ struct lttng_consumer_channel *channel);
+
struct lttng_consumer_stream *consumer_allocate_stream(uint64_t channel_key,
uint64_t stream_key,
enum lttng_consumer_stream_state state,
struct lttng_consumer_stream *stream, unsigned long len,
unsigned long padding,
struct ctf_packet_index *index);
+int lttng_consumer_sample_snapshot_positions(struct lttng_consumer_stream *stream);
int lttng_consumer_take_snapshot(struct lttng_consumer_stream *stream);
int lttng_consumer_get_produced_snapshot(struct lttng_consumer_stream *stream,
unsigned long *pos);
+int lttng_consumer_get_consumed_snapshot(struct lttng_consumer_stream *stream,
+ unsigned long *pos);
int lttng_ustconsumer_get_wakeup_fd(struct lttng_consumer_stream *stream);
int lttng_ustconsumer_close_wakeup_fd(struct lttng_consumer_stream *stream);
void *consumer_thread_metadata_poll(void *data);