X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer-metadata-cache.h;h=b8f4efadc4c5ec59913cb75ea1644882fab2331b;hb=4878de5c7deb512bbdac4fdfc498907efa06fb7c;hp=4c029b90e9208fdf74b1e8a6745028de49bb340a;hpb=b1316da1ffbd276fc8271e7a9438e683ad352781;p=lttng-tools.git diff --git a/src/common/consumer/consumer-metadata-cache.h b/src/common/consumer/consumer-metadata-cache.h index 4c029b90e..b8f4efadc 100644 --- a/src/common/consumer/consumer-metadata-cache.h +++ b/src/common/consumer/consumer-metadata-cache.h @@ -10,6 +10,7 @@ #define CONSUMER_METADATA_CACHE_H #include +#include enum consumer_metadata_cache_write_status { CONSUMER_METADATA_CACHE_WRITE_STATUS_ERROR = -1, @@ -33,23 +34,16 @@ enum consumer_metadata_cache_write_status { }; struct consumer_metadata_cache { - char *data; - uint64_t cache_alloc_size; - /* - * Current version of the metadata cache. - */ + /* Current version of the metadata cache. */ uint64_t version; /* - * 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. + * Size is the upper-limit of data written inside the buffer. * All cached data is contiguous. */ - uint64_t max_offset; + struct lttng_dynamic_buffer contents; /* * Lock to update the metadata cache and push into the ring_buffer - * (ustctl_write_metadata_to_channel). + * (lttng_ust_ctl_write_metadata_to_channel). * * This is nested INSIDE the consumer_data lock. */ @@ -57,7 +51,7 @@ struct consumer_metadata_cache { }; enum consumer_metadata_cache_write_status -consumer_metadata_cache_write(struct lttng_consumer_channel *channel, +consumer_metadata_cache_write(struct consumer_metadata_cache *cache, unsigned int offset, unsigned int len, uint64_t version, const char *data); int consumer_metadata_cache_allocate(struct lttng_consumer_channel *channel);