From: Jonathan Rajotte Date: Tue, 22 Mar 2016 18:12:04 +0000 (-0400) Subject: Fix: do not return error on LTTNG_ERR_SNAPSHOT_NODATA X-Git-Tag: v2.6.3~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4bab9f0d237a16be490e9ea35089bc212dc1c8c4;p=lttng-tools.git Fix: do not return error on LTTNG_ERR_SNAPSHOT_NODATA 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 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/snapshot.c b/src/bin/lttng/commands/snapshot.c index fd209c150..7315cb1a1 100644 --- a/src/bin/lttng/commands/snapshot.c +++ b/src/bin/lttng/commands/snapshot.c @@ -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));