Remove dead code in lttng-sessiond
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 23 Aug 2015 03:24:17 +0000 (23:24 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 23 Aug 2015 04:24:13 +0000 (00:24 -0400)
event_ust_enable_all_tracepoints and event_ust_disable_all_tracepoints
are both never used by the session daemon.

src/bin/lttng-sessiond/event.c
src/bin/lttng-sessiond/event.h

index e9192900892acb831fdc32ab160bc7c9f3e28a5b..017efa1d5a7d2fd7bd86ac48aa0efb42444b562f 100644 (file)
@@ -186,103 +186,6 @@ end:
  * ============================
  */
 
-/*
- * Enable all UST tracepoints for a channel from a UST session.
- */
-int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan,
-               char *filter_expression,
-               struct lttng_filter_bytecode *filter)
-{
-       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();
-
-       /* Enable existing events */
-       cds_lfht_for_each_entry(uchan->events->ht, &iter.iter, uevent,
-                       node.node) {
-               if (uevent->enabled == 0) {
-                       ret = ust_app_enable_event_glb(usess, uchan, uevent);
-                       if (ret < 0) {
-                               continue;
-                       }
-                       uevent->enabled = 1;
-               }
-       }
-
-       /* 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++) {
-               /*
-                * Check if event exist and if so, continue since it was enable
-                * previously.
-                */
-               uevent = trace_ust_find_event(uchan->events, events[i].name, filter,
-                               events[i].loglevel, NULL);
-               if (uevent != NULL) {
-                       ret = ust_app_enable_event_pid(usess, uchan, uevent,
-                                       events[i].pid);
-                       if (ret < 0) {
-                               if (ret != -LTTNG_UST_ERR_EXIST) {
-                                       ret = LTTNG_ERR_UST_ENABLE_FAIL;
-                                       goto error;
-                               }
-                       }
-                       continue;
-               }
-
-               /* Create ust event */
-               uevent = trace_ust_create_event(&events[i], filter_expression,
-                       filter, NULL);
-               if (uevent == NULL) {
-                       ret = LTTNG_ERR_FATAL;
-                       goto error_destroy;
-               }
-
-               /* Create event for the specific PID */
-               ret = ust_app_enable_event_pid(usess, uchan, uevent,
-                               events[i].pid);
-               if (ret < 0) {
-                       if (ret == -LTTNG_UST_ERR_EXIST) {
-                               ret = LTTNG_ERR_UST_EVENT_EXIST;
-                               goto error;
-                       } else {
-                               ret = LTTNG_ERR_UST_ENABLE_FAIL;
-                               goto error_destroy;
-                       }
-               }
-
-               uevent->enabled = 1;
-               /* Add ltt ust event to channel */
-               rcu_read_lock();
-               add_unique_ust_event(uchan->events, uevent);
-               rcu_read_unlock();
-       }
-       free(events);
-
-       rcu_read_unlock();
-       return LTTNG_OK;
-
-error_destroy:
-       trace_ust_destroy_event(uevent);
-
-error:
-       free(events);
-       rcu_read_unlock();
-       return ret;
-}
-
 /*
  * Enable UST tracepoint event for a channel from a UST session.
  * We own filter_expression, filter, and exclusion.
@@ -448,60 +351,6 @@ 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;
-               }
-       }
-       free(events);
-
-       rcu_read_unlock();
-       return LTTNG_OK;
-
-error:
-       free(events);
-       rcu_read_unlock();
-       return ret;
-}
-
 /*
  * Enable all agent event for a given UST session.
  *
index 37f98608747b6594c4f72867ceeccc9daf72d767..21fac1ec09a3fba465e16dc74a7f396cb6c31201 100644 (file)
@@ -40,13 +40,6 @@ 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_enable_all_tracepoints(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan,
-               char *filter_expression,
-               struct lttng_filter_bytecode *filter);
-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);
 int event_agent_enable_all(struct ltt_ust_session *usess, struct agent *agt,
This page took 0.054485 seconds and 4 git commands to generate.