X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer-stream.h;h=021742e431f62f469162779168002d7024408f7c;hb=1970828049d051d5cb485dfab995081b4550fd2a;hp=50e402fe200f1c90f0e06c62622c12f6f29b38d5;hpb=55954e07e828c0ec1c059a50996252a358f7dd23;p=lttng-tools.git diff --git a/src/common/consumer/consumer-stream.h b/src/common/consumer/consumer-stream.h index 50e402fe2..021742e43 100644 --- a/src/common/consumer/consumer-stream.h +++ b/src/common/consumer/consumer-stream.h @@ -10,6 +10,12 @@ #include "consumer.h" +enum consumer_stream_open_packet_status { + CONSUMER_STREAM_OPEN_PACKET_STATUS_OPENED, + CONSUMER_STREAM_OPEN_PACKET_STATUS_NO_SPACE, + CONSUMER_STREAM_OPEN_PACKET_STATUS_ERROR, +}; + /* * Create a consumer stream. * @@ -130,4 +136,24 @@ int consumer_stream_enable_metadata_bucketization( void consumer_stream_metadata_set_version( struct lttng_consumer_stream *stream, uint64_t new_version); +/* + * Attempt to open a packet in a stream. + * + * This function must be called with the stream and channel locks held. + */ +enum consumer_stream_open_packet_status consumer_stream_open_packet( + struct lttng_consumer_stream *stream); + +/* + * Flush a stream's buffer. + * + * producer_active: if true, causes a flush to occur only if there is + * content present in the current sub-buffer. If false, forces a flush to take + * place (otherwise known as "flush_empty"). + * + * This function must be called with the stream and channel locks held. + */ +int consumer_stream_flush_buffer(struct lttng_consumer_stream *stream, + bool producer_active); + #endif /* LTTNG_CONSUMER_STREAM_H */