X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-metadata-cache.c;h=6774692316a6dc4fe1b3e1a0fdf33d09fbc0c960;hb=c585821bc78955b3d747fcd733aa1d2b81a3258e;hp=0f086fe9643218ba91837446b031154c91453e58;hpb=53efb85a242809ed5ed21e9ab40effa696ecbc6f;p=lttng-tools.git diff --git a/src/common/consumer-metadata-cache.c b/src/common/consumer-metadata-cache.c index 0f086fe96..677469231 100644 --- a/src/common/consumer-metadata-cache.c +++ b/src/common/consumer-metadata-cache.c @@ -17,6 +17,7 @@ */ #define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include @@ -72,8 +73,8 @@ end: /* * Write metadata to the cache, extend the cache if necessary. We support - * non-contiguous updates but not overlapping ones. If there is contiguous - * metadata in the cache, we send it to the ring buffer. The metadata cache + * overlapping updates, but they need to be contiguous. Send the + * contiguous metadata in cache to the ring buffer. The metadata cache * lock MUST be acquired to write in the cache. * * Return 0 on success, a negative value on error. @@ -101,15 +102,10 @@ int consumer_metadata_cache_write(struct lttng_consumer_channel *channel, } memcpy(cache->data + offset, data, len); - cache->total_bytes_written += len; if (offset + len > cache->max_offset) { - cache->max_offset = offset + len; - } - - if (cache->max_offset == cache->total_bytes_written) { char dummy = 'c'; - cache->contiguous = cache->max_offset; + cache->max_offset = offset + len; if (channel->monitor) { size_ret = lttng_write(channel->metadata_stream->ust_metadata_poll_pipe[1], &dummy, 1);