X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer.h;h=a7d0ee1a706cc719f6877b168a6819f97f72b0ac;hp=eb2958e20669593ed4c8cb7b199c3c3f3fa06039;hb=d9a2e16ee3abce83801f58473831330aa8a5463b;hpb=261de6373c70dcd52421642db5486747e9c10bae diff --git a/src/common/consumer/consumer.h b/src/common/consumer/consumer.h index eb2958e20..a7d0ee1a7 100644 --- a/src/common/consumer/consumer.h +++ b/src/common/consumer/consumer.h @@ -415,6 +415,17 @@ struct lttng_consumer_stream { 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; /* @@ -662,6 +673,14 @@ void lttng_consumer_cleanup(void); */ 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,