X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer-stream.h;h=61dc773f78a215fcdc37d066af4e8b1a1783e0a5;hb=443d6e6f2a835be2843cbe41e7a7ba3fee838f20;hp=8bda682bd9bdd4620e4af359b5365c919f61d636;hpb=e5148e25a481691b3278cd85a6ff25c1e25e4d2e;p=lttng-tools.git diff --git a/src/common/consumer/consumer-stream.h b/src/common/consumer/consumer-stream.h index 8bda682bd..61dc773f7 100644 --- a/src/common/consumer/consumer-stream.h +++ b/src/common/consumer/consumer-stream.h @@ -20,6 +20,24 @@ #include "consumer.h" +/* + * Create a consumer stream. + * + * The channel lock MUST be acquired. + */ +struct lttng_consumer_stream *consumer_stream_create( + struct lttng_consumer_channel *channel, + uint64_t channel_key, + uint64_t stream_key, + const char *channel_name, + uint64_t relayd_id, + uint64_t session_id, + struct lttng_trace_chunk *trace_chunk, + int cpu, + int *alloc_ret, + enum consumer_channel_type type, + unsigned int monitor); + /* * Close stream's file descriptors and, if needed, close stream also on the * relayd side. @@ -78,7 +96,7 @@ int consumer_stream_sync_metadata(struct lttng_consumer_local_data *ctx, uint64_t session_id); /* - * Create the output files of a local stream. + * Create the output files of a local stream. * * This must be called with the channel's and the stream's lock held. */ @@ -94,4 +112,32 @@ int consumer_stream_create_output_files(struct lttng_consumer_stream *stream, */ int consumer_stream_rotate_output_files(struct lttng_consumer_stream *stream); +/* + * Indicates whether or not a stream is logically deleted. A deleted stream + * should no longer be used; its existence is only garanteed by the RCU lock + * held by the caller. + * + * This function must be called with the RCU read side lock held. + */ +bool consumer_stream_is_deleted(struct lttng_consumer_stream *stream); + +/* + * Enable metadata bucketization. This must only be enabled if the tracer + * provides a reliable metadata `coherent` flag. + * + * This must be called on initialization before any subbuffer is consumed. + */ +int consumer_stream_enable_metadata_bucketization( + struct lttng_consumer_stream *stream); + +/* + * Set the version of a metadata stream (i.e. following a metadata + * regeneration). + * + * Changing the version of a metadata stream will cause any bucketized metadata + * to be discarded and will mark the metadata stream for future `reset`. + */ +void consumer_stream_metadata_set_version( + struct lttng_consumer_stream *stream, uint64_t new_version); + #endif /* LTTNG_CONSUMER_STREAM_H */