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 15:22:06 +0000 (11:22 -0400)
commitbc93eeca040cab99277daf1bffe87416b62e2532
tree8a9fba062794e6c67842875927d767596ac59a9e
parent27585b307a10773445cb3e94b49295ff56e2efdf
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.024967 seconds and 4 git commands to generate.