From: Mathieu Desnoyers Date: Wed, 18 May 2016 18:04:13 +0000 (-0400) Subject: Fix: ust-consumer: flush empty packets on snapshot channel X-Git-Tag: v2.8.0~21 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=964f17f3183d74713de9075d3144c9a76f9e1076;p=lttng-tools.git Fix: ust-consumer: flush empty packets on snapshot channel Snapshot operation on a non-stopped stream should use a "final" flush to ensure empty packets are flushed, so we gather timestamps at the moment where the snapshot is taken. This is important for streams that have a low amount of activity, which might be on an empty packet when the snapshot is triggered. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index a66f305cd..89109b919 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -1111,7 +1111,13 @@ static int snapshot_channel(uint64_t key, char *path, uint64_t relayd_id, } } - ustctl_flush_buffer(stream->ustream, 1); + /* + * If tracing is active, we want to perform a "full" buffer flush. + * Else, if quiescent, it has already been done by the prior stop. + */ + if (!stream->quiescent) { + ustctl_flush_buffer(stream->ustream, 0); + } ret = lttng_ustconsumer_take_snapshot(stream); if (ret < 0) {