From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeremie.galarneau@efficios.com (=?UTF-8?Q?J=C3=A9r=C3=A9mie_Galarneau?=) Date: Thu, 19 May 2016 00:12:16 -0400 Subject: [lttng-dev] [PATCH lttng-tools 04/10] Fix: ust-consumer: flush empty packets on snapshot channel In-Reply-To: <1463594659-10964-5-git-send-email-mathieu.desnoyers@efficios.com> References: <1463594659-10964-1-git-send-email-mathieu.desnoyers@efficios.com> <1463594659-10964-5-git-send-email-mathieu.desnoyers@efficios.com> Message-ID: Merged, thanks! Jérémie On Wed, May 18, 2016 at 2:04 PM, Mathieu Desnoyers wrote: > 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 > --- > src/common/ust-consumer/ust-consumer.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c > index 91ffdce..c631904 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) { > -- > 2.1.4 > -- Jérémie Galarneau EfficiOS Inc. http://www.efficios.com