Fix: kernel consumer: get next subbuffer EAGAIN handling
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 30 Apr 2021 16:02:47 +0000 (12:02 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 11 May 2021 17:30:07 +0000 (13:30 -0400)
commit24cb9f69c5b6247c8c955252f7e468d4c473d4f1
tree042c73e35836cb234c9f8d5589dadb5e042b8423
parent1bfbabab0171e4243edbf1d7e9e9b6c11f549460
Fix: kernel consumer: get next subbuffer EAGAIN handling

The caller of get next subbuffer (data and metadata) callbacks only
expects -ENODATA when there is no data to read. However, the kernel
tracer distinguishes between no data for a finalized stream (-ENODATA)
and no data for a non-finalized stream (-EAGAIN).

Given that the consumer daemon uses the POLLHUP returned by epoll to
detect stream end of life, it does not care about the distinction
between -EAGAIN and -ENODATA when streaming.

However, taking a snapshot of a metadata stream uses the distinction
between nodata and again. Change this so it considers a return value of
0 from lttng_consumer_read_subbuffer to mean there is no more data to
read, so we can combine -EAGAIN and -ENODATA within get next subbuffer
callbacks and return -ENODATA for both.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ifb157dbe28498279dce30e9efa3b5aedcf3f9b1d
src/common/kernel-consumer/kernel-consumer.c
This page took 0.027569 seconds and 4 git commands to generate.