From: Mathieu Desnoyers Date: Fri, 30 Apr 2021 16:02:47 +0000 (-0400) Subject: Fix: kernel consumer: get next subbuffer EAGAIN handling X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=6e5e3c512dd7c4ead8ce89bff2de1a56a6d5e360;hp=6e5e3c512dd7c4ead8ce89bff2de1a56a6d5e360;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: I30786985c2389570dd342e55d4faf7c552532f8b ---