From fa2f196b44f1b8fa07671658b8c74f37477c18cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 17 Jun 2020 18:27:52 -0400 Subject: [PATCH] consumerd: on_sleep not called on stream when no data is available MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/consumer/consumer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 50951fd28..cbd99e7ec 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -3347,6 +3347,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; } @@ -3412,6 +3413,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, goto end; } +stream_sleep: if (stream->read_subbuffer_ops.on_sleep) { stream->read_subbuffer_ops.on_sleep(stream, ctx); } -- 2.34.1