From: Julien Desfossez Date: Mon, 11 Dec 2017 21:11:09 +0000 (-0500) Subject: Fix: kernel snapshot handling of EAGAIN X-Git-Tag: v2.10.4~12 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6bcde26bf3807c35a04824ed1497c540d9d69839;p=lttng-tools.git Fix: kernel snapshot handling of EAGAIN kernctl_snapshot can return EAGAIN, this is not an error, it only means there is no data to read. Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index 1c2751b59..642193230 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -60,7 +60,11 @@ int lttng_kconsumer_take_snapshot(struct lttng_consumer_stream *stream) int infd = stream->wait_fd; ret = kernctl_snapshot(infd); - if (ret != 0) { + /* + * -EAGAIN is not an error, it just means that there is no data to + * be read. + */ + if (ret != 0 && ret != -EAGAIN) { PERROR("Getting sub-buffer snapshot."); }