Bring back event_ust_disable_all_tracepoints
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 10 Sep 2015 20:10:55 +0000 (16:10 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 17 Sep 2015 00:54:49 +0000 (20:54 -0400)
Revert part of be42c96885c522f857f146fa6f7ae53856e3bed2

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
src/bin/lttng-sessiond/event.h

index fdec4a9dd720010e71926221c76da879b6aec8b9..fc3757534dea7243cff864d12c6cfa965c6ef8c5 100644 (file)
@@ -352,6 +352,57 @@ error:
        return ret;
 }
 
+/*
+ * Disable all UST tracepoints for a channel from a UST session.
+ */
+int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess,
+               struct ltt_ust_channel *uchan)
+{
+       int ret, i, size;
+       struct lttng_ht_iter iter;
+       struct ltt_ust_event *uevent = NULL;
+       struct lttng_event *events = NULL;
+
+       assert(usess);
+       assert(uchan);
+
+       rcu_read_lock();
+
+       /* Disabling existing events */
+       cds_lfht_for_each_entry(uchan->events->ht, &iter.iter, uevent,
+                       node.node) {
+               if (uevent->enabled == 1) {
+                       ret = event_ust_disable_tracepoint(usess, uchan,
+                                       uevent->attr.name);
+                       if (ret < 0) {
+                               continue;
+                       }
+               }
+       }
+
+       /* Get all UST available events */
+       size = ust_app_list_events(&events);
+       if (size < 0) {
+               ret = LTTNG_ERR_UST_LIST_FAIL;
+               goto error;
+       }
+
+       for (i = 0; i < size; i++) {
+               ret = event_ust_disable_tracepoint(usess, uchan,
+                               events[i].name);
+               if (ret != LTTNG_OK) {
+                       /* Continue to disable the rest... */
+                       continue;
+               }
+       }
+
+       ret = LTTNG_OK;
+error:
+       rcu_read_unlock();
+       free(events);
+       return ret;
+}
+
 /*
  * Enable all agent event for a given UST session.
  *
index 4e7de911cd812f2d96841e7934735ee3ca1b4cea..2afe159a648d6f2fc8c62c0c4f21d9808b527c24 100644 (file)
@@ -40,6 +40,9 @@ int event_ust_enable_tracepoint(struct ltt_ust_session *usess,
 int event_ust_disable_tracepoint(struct ltt_ust_session *usess,
                struct ltt_ust_channel *uchan, char *event_name);
 
+int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess,
+               struct ltt_ust_channel *uchan);
+
 int event_agent_enable(struct ltt_ust_session *usess, struct agent *agt,
                struct lttng_event *event, struct lttng_filter_bytecode *filter,
                char *filter_expression);
This page took 0.026827 seconds and 4 git commands to generate.