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-Tag: v2.13.0-rc1~608 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=e66d26f5110d65c1f9549904a33986797a3759a4 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 --- 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); }