From: Julien Desfossez Date: Mon, 11 Dec 2017 21:11:09 +0000 (-0500) Subject: Fix: kernel snapshot handling of EAGAIN X-Git-Tag: v2.9.9~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ee6bb36a4235a005b7d674f341f50c10b2ae52aa;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 1079047f0..0afa143a5 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."); }