Fix: kernel snapshot handling of EAGAIN
authorJulien Desfossez <jdesfossez@efficios.com>
Mon, 11 Dec 2017 21:11:09 +0000 (16:11 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 8 Mar 2018 02:21:32 +0000 (21:21 -0500)
kernctl_snapshot can return EAGAIN, this is not an error, it only means
there is no data to read.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/kernel-consumer/kernel-consumer.c

index 185d42320731d026e26a167a3809a731ce597b05..103df665a78d73dd319a5a6566894f9279e1cb9e 100644 (file)
@@ -60,7 +60,11 @@ int lttng_kconsumer_take_snapshot(struct lttng_consumer_stream *stream)
        int infd = stream->wait_fd;
 
        ret = kernctl_snapshot(infd);
        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.");
        }
 
                PERROR("Getting sub-buffer snapshot.");
        }
 
This page took 0.02916 seconds and 5 git commands to generate.