[lttng-dev] [PATCH lttng-tools v2 1/5] Fix: do not return error on LTTNG_ERR_SNAPSHOT_NODATA

Jérémie Galarneau jeremie.galarneau at efficios.com
Mon Apr 4 16:49:26 UTC 2016


Merged, thanks!

Jérémie

On Tue, Mar 22, 2016 at 2:12 PM, Jonathan Rajotte
<jonathan.rajotte-julien at efficios.com> wrote:
> 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 at efficios.com>
> ---
>  src/bin/lttng/commands/snapshot.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/bin/lttng/commands/snapshot.c b/src/bin/lttng/commands/snapshot.c
> index abdf189..298bc6e 100644
> --- a/src/bin/lttng/commands/snapshot.c
> +++ b/src/bin/lttng/commands/snapshot.c
> @@ -725,6 +725,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));
> --
> 2.7.0
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list