From: Julien Desfossez Date: Mon, 11 Dec 2017 21:11:09 +0000 (-0500) Subject: Fix: kernel snapshot handling of EAGAIN X-Git-Tag: v2.11.0-rc1~360 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d2d2f190a6cd2c77b9eef563518e3a2705c6e3bc;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 185d42320..103df665a 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."); }