Fix: do not return error on LTTNG_ERR_SNAPSHOT_NODATA
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 22 Mar 2016 18:12:04 +0000 (14:12 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 20 May 2016 20:42:30 +0000 (16:42 -0400)
A warning is fine since the user has no control on
whether or not applications (or the kernel) have
produced any event between the start of the tracing
session and the recording of the snapshot.

MI wise the command is not a success since nothing was
recorded. The command line return code is CMD_SUCCESS.

refs #1002

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/snapshot.c

index fd209c1507ec5ccc9cb36e1ac8b6d077c8e4e656..7315cb1a1a3397ff02c8925614f8647105533bb7 100644 (file)
@@ -764,6 +764,15 @@ int cmd_snapshot(int argc, const char **argv)
                        break;
                case LTTNG_ERR_SNAPSHOT_NODATA:
                        WARN("%s", lttng_strerror(command_ret));
+
+                       /*  A warning is fine since the user has no control on
+                        *  whether or not applications (or the kernel) have
+                        *  produced any event between the start of the tracing
+                        *  session and the recording of the snapshot. MI wise
+                        *  the command is not a success since nothing was
+                        *  recorded.
+                        */
+                       command_ret = 0;
                        break;
                default:
                        ERR("%s", lttng_strerror(command_ret));
This page took 0.02547 seconds and 4 git commands to generate.