X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-metadata-cache.c;h=cbd3ef3945a5065017dbe1dc46c354fa10446aa5;hp=9cd99e5bf4d29f090baeb0c8326ce10ba880f2c7;hb=890d8fe47755c3bad936389cf48ffa141cff41c9;hpb=6c1c0768320135c6936c371b09731851b508c023 diff --git a/src/common/consumer-metadata-cache.c b/src/common/consumer-metadata-cache.c index 9cd99e5bf..cbd3ef394 100644 --- a/src/common/consumer-metadata-cache.c +++ b/src/common/consumer-metadata-cache.c @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -73,8 +72,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. @@ -102,15 +101,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);