Remove unused code
authorDavid Goulet <dgoulet@efficios.com>
Tue, 16 Oct 2012 15:42:23 +0000 (11:42 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 19 Oct 2012 16:49:01 +0000 (12:49 -0400)
The consumer change stream state function has been removed since it was
not only not used but using the stream_ht also removed with this patch.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c
src/common/consumer.h
src/common/ust-consumer/ust-consumer.c

index fb0d7d05afb182992c97c789dcdd54544bb2fcea..0f0e60ad839a9beab57168634a8d7220a86fae62 100644 (file)
@@ -623,23 +623,6 @@ error:
        return outfd;
 }
 
-/*
- * Update a stream according to what we just received.
- */
-void consumer_change_stream_state(int stream_key,
-               enum lttng_consumer_stream_state state)
-{
-       struct lttng_consumer_stream *stream;
-
-       pthread_mutex_lock(&consumer_data.lock);
-       stream = consumer_find_stream(stream_key, consumer_data.stream_ht);
-       if (stream) {
-               stream->state = state;
-       }
-       consumer_data.need_update = 1;
-       pthread_mutex_unlock(&consumer_data.lock);
-}
-
 static
 void consumer_free_channel(struct rcu_head *head)
 {
@@ -897,17 +880,6 @@ void lttng_consumer_cleanup(void)
 
        rcu_read_lock();
 
-       /*
-        * close all outfd. Called when there are no more threads running (after
-        * joining on the threads), no need to protect list iteration with mutex.
-        */
-       cds_lfht_for_each_entry(consumer_data.stream_ht->ht, &iter.iter, node,
-                       node) {
-               struct lttng_consumer_stream *stream =
-                       caa_container_of(node, struct lttng_consumer_stream, node);
-               consumer_del_stream(stream, consumer_data.stream_ht);
-       }
-
        cds_lfht_for_each_entry(consumer_data.channel_ht->ht, &iter.iter, node,
                        node) {
                struct lttng_consumer_channel *channel =
@@ -917,7 +889,6 @@ void lttng_consumer_cleanup(void)
 
        rcu_read_unlock();
 
-       lttng_ht_destroy(consumer_data.stream_ht);
        lttng_ht_destroy(consumer_data.channel_ht);
 }
 
@@ -2335,7 +2306,6 @@ int lttng_consumer_on_recv_stream(struct lttng_consumer_stream *stream)
  */
 void lttng_consumer_init(void)
 {
-       consumer_data.stream_ht = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
        consumer_data.channel_ht = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
        consumer_data.relayd_ht = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
 
index 058bd695b9f6ee41c317e204f97d632c95efe294..fe1568382f3971728fb2a15fbc4b7bec348541d5 100644 (file)
@@ -101,8 +101,8 @@ struct lttng_ust_lib_ring_buffer;
  * uniquely a stream.
  */
 struct lttng_consumer_stream {
+       /* Hash table node for both metadata and data type */
        struct lttng_ht_node_ulong node;
-       struct lttng_ht_node_ulong waitfd_node;
        struct lttng_consumer_channel *chan;    /* associated channel */
        /*
         * key is the key used by the session daemon to refer to the
@@ -253,13 +253,12 @@ struct lttng_consumer_global_data {
        pthread_mutex_t lock;
 
        /*
-        * Number of streams in the hash table. Protected by consumer_data.lock.
+        * Number of streams in the data stream hash table declared outside.
+        * Protected by consumer_data.lock.
         */
        int stream_count;
-       /*
-        * Hash tables of streams and channels. Protected by consumer_data.lock.
-        */
-       struct lttng_ht *stream_ht;
+
+       /* Channel hash table protected by consumer_data.lock. */
        struct lttng_ht *channel_ht;
        /*
         * Flag specifying if the local array of FDs needs update in the
@@ -344,8 +343,6 @@ extern void consumer_del_stream(struct lttng_consumer_stream *stream,
                struct lttng_ht *ht);
 extern void consumer_del_metadata_stream(struct lttng_consumer_stream *stream,
                struct lttng_ht *ht);
-extern void consumer_change_stream_state(int stream_key,
-               enum lttng_consumer_stream_state state);
 extern void consumer_del_channel(struct lttng_consumer_channel *channel);
 extern struct lttng_consumer_channel *consumer_allocate_channel(
                int channel_key,
index 5886d89b598cab2f4d54aad2868e3172343eaac4..dea92ac2374f3f5127dc97389ed6f054d8f49d69 100644 (file)
@@ -308,20 +308,6 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
        {
                rcu_read_unlock();
                return -ENOSYS;
-#if 0
-               if (ctx->on_update_stream != NULL) {
-                       ret = ctx->on_update_stream(msg.u.stream.stream_key, msg.u.stream.state);
-                       if (ret == 0) {
-                               consumer_change_stream_state(msg.u.stream.stream_key, msg.u.stream.state);
-                       } else if (ret < 0) {
-                               goto end;
-                       }
-               } else {
-                       consumer_change_stream_state(msg.u.stream.stream_key,
-                               msg.u.stream.state);
-               }
-               break;
-#endif
        }
        default:
                break;
This page took 0.029296 seconds and 4 git commands to generate.