Report error if any disable action fails
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 10 Sep 2015 20:10:57 +0000 (16:10 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 17 Sep 2015 00:54:59 +0000 (20:54 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/event.c

index fc3757534dea7243cff864d12c6cfa965c6ef8c5..869aa2dd2c374098821dab3d4f411f64cc59f523 100644 (file)
@@ -358,7 +358,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;
@@ -375,6 +375,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;
                        }
                }
@@ -390,13 +391,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;
                }
        }
 
-       ret = LTTNG_OK;
+       ret = error ? error : LTTNG_OK;
 error:
        rcu_read_unlock();
        free(events);
This page took 0.025376 seconds and 4 git commands to generate.