X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=08161c27e1f3ff2fc4932c87701171a15a96c743;hb=e6ee4eabf5141d475fd734376c752d821e74e670;hp=9b1675e8be94b89b560dcd77db1e36e5fedb8775;hpb=f5481aa9adff33804a2003baa1157043c35a1ccd;p=lttng-tools.git diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 9b1675e8b..08161c27e 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -1746,6 +1746,12 @@ int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream) } if (stream->chan->type == CONSUMER_CHANNEL_TYPE_METADATA) { + uint64_t contiguous, pushed; + + /* Ease our life a bit. */ + contiguous = stream->chan->metadata_cache->contiguous; + pushed = stream->ust_metadata_pushed; + /* * We can simply check whether all contiguously available data * has been pushed to the ring buffer, since the push operation @@ -1757,10 +1763,10 @@ int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream) * metadata has been consumed from the metadata stream. */ DBG("UST consumer metadata pending check: contiguous %" PRIu64 " vs pushed %" PRIu64, - stream->chan->metadata_cache->contiguous, - stream->ust_metadata_pushed); - if (stream->chan->metadata_cache->contiguous - != stream->ust_metadata_pushed) { + contiguous, pushed); + assert(contiguous - pushed >= 0); + if ((contiguous != pushed) || + (contiguous - pushed > 0 || contiguous == 0)) { ret = 1; /* Data is pending */ goto end; }