Keep read-only copies of fields from the channel to the stream
[lttng-tools.git] / src / common / consumer / consumer.h
index eb2958e20669593ed4c8cb7b199c3c3f3fa06039..a7d0ee1a706cc719f6877b168a6819f97f72b0ac 100644 (file)
@@ -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,
This page took 0.024081 seconds and 5 git commands to generate.