[lttng-dev] [PATCH lttng-tools 3/3] Report error if any disable action fails

Jérémie Galarneau jeremie.galarneau at efficios.com
Wed Sep 16 16:32:08 EDT 2015


Merged, thanks!

Jérémie

On Thu, Sep 10, 2015 at 4:10 PM, Jonathan Rajotte
<jonathan.rajotte-julien at efficios.com> wrote:
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
> ---
>  src/bin/lttng-sessiond/event.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c
> index b5087a2..cfb8549 100644
> --- a/src/bin/lttng-sessiond/event.c
> +++ b/src/bin/lttng-sessiond/event.c
> @@ -359,7 +359,7 @@ error:
>  int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess,
>                 struct ltt_ust_channel *uchan)
>  {
> -       int ret, i, size;
> +       int ret, i, size, error = 0;
>         struct lttng_ht_iter iter;
>         struct ltt_ust_event *uevent = NULL;
>         struct lttng_event *events = NULL;
> @@ -376,6 +376,7 @@ int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess,
>                         ret = event_ust_disable_tracepoint(usess, uchan,
>                                         uevent->attr.name);
>                         if (ret < 0) {
> +                               error = LTTNG_ERR_UST_DISABLE_FAIL;
>                                 continue;
>                         }
>                 }
> @@ -391,15 +392,14 @@ int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess,
>         for (i = 0; i < size; i++) {
>                 ret = event_ust_disable_tracepoint(usess, uchan,
>                                 events[i].name);
> -               if (ret != LTTNG_OK) {
> +               if (ret < 0) {
>                         /* Continue to disable the rest... */
> +                       error = LTTNG_ERR_UST_DISABLE_FAIL;
>                         continue;
>                 }
>         }
> -       free(events);
>
> -       rcu_read_unlock();
> -       return LTTNG_OK;
> +       ret = error ? error : LTTNG_OK;
>
>  error:
>         free(events);
> --
> 2.1.4
>



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



More information about the lttng-dev mailing list