From: Jérémie Galarneau Date: Wed, 17 Jun 2020 22:27:52 +0000 (-0400) Subject: consumerd: on_sleep not called on stream when no data is available X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=558cd39fb7504ea3e52fdba116718edb8018c59d consumerd: on_sleep not called on stream when no data is available The `on_sleep` stream operation is not invoked when a stream's `get` operation returns ENODATA (no data available). Since this is not an error, the normal steps of the consumption loops should be assumed. Not marked as a fix as this is not problematic right now. However, it could prove misleading in the future. Signed-off-by: Jérémie Galarneau Change-Id: I0812e3af4c967390ebba4128781787abf45c76a1 Cherry-pick difference: merge conflict on rotation. Simply deleted the rotation related code. Change-Id: Ic840361477d77eae387573a1bb0949636abe9b12 --- diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index bae4c294b..8a2a0f9c9 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -3165,6 +3165,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, if (ret == -ENODATA) { /* Not an error. */ ret = 0; + goto sleep_stream; } goto end; } @@ -3209,6 +3210,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, } } +stream_sleep: if (stream->read_subbuffer_ops.on_sleep) { stream->read_subbuffer_ops.on_sleep(stream, ctx); }