X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-metadata-cache.h;h=e7aba4ac923778fea3594ce9161390bd1286450a;hp=164f9eaae0689d68262e007278bbfc82a3a7d6ac;hb=b83e03c49920557f292d3861f42d0109e6fa03ea;hpb=331744e34f56a5aec69b05d356d6901e67926acc diff --git a/src/common/consumer-metadata-cache.h b/src/common/consumer-metadata-cache.h index 164f9eaae..e7aba4ac9 100644 --- a/src/common/consumer-metadata-cache.h +++ b/src/common/consumer-metadata-cache.h @@ -24,25 +24,19 @@ struct consumer_metadata_cache { char *data; uint64_t cache_alloc_size; - /* - * How many bytes from the cache were already sent to the ring buffer. - */ - uint64_t rb_pushed; - /* - * How many bytes are written in the buffer (excluding the wholes). - */ - uint64_t total_bytes_written; /* * The upper-limit of data written inside the buffer. * * With the total_bytes_written it allows us to keep track of when the * cache contains contiguous metadata ready to be sent to the RB. - * The metadata cache updates must not overlap. + * All cached data is contiguous. */ uint64_t max_offset; /* * Lock to update the metadata cache and push into the ring_buffer * (ustctl_write_metadata_to_channel). + * + * This is nested INSIDE the consumer_data lock. */ pthread_mutex_t lock; }; @@ -52,6 +46,6 @@ int consumer_metadata_cache_write(struct lttng_consumer_channel *channel, int consumer_metadata_cache_allocate(struct lttng_consumer_channel *channel); void consumer_metadata_cache_destroy(struct lttng_consumer_channel *channel); int consumer_metadata_cache_flushed(struct lttng_consumer_channel *channel, - uint64_t offset); + uint64_t offset, int timer); #endif /* CONSUMER_METADATA_CACHE_H */