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>
Fri, 7 May 2021 17:47:51 +0000 (13:47 -0400)
commit684c67832af216ca44420a320e6076302a8dd2f9
tree8e36c46adca39a91102c3e05fb217ec69329c615
parentee0350f8480addf9d786664e748645ab73a84565
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: I30786985c2389570dd342e55d4faf7c552532f8b
src/common/kernel-consumer/kernel-consumer.c
This page took 0.03163 seconds and 4 git commands to generate.