From: Mathieu Desnoyers Date: Fri, 30 Apr 2021 16:02:47 +0000 (-0400) Subject: Fix: kernel consumer: get next subbuffer EAGAIN handling X-Git-Tag: v2.11.7~4 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=24cb9f69c5b6247c8c955252f7e468d4c473d4f1;hp=24cb9f69c5b6247c8c955252f7e468d4c473d4f1;p=lttng-tools.git 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 Signed-off-by: Jérémie Galarneau Change-Id: Ifb157dbe28498279dce30e9efa3b5aedcf3f9b1d ---