Create a consumer daemon trace chunk registry on launch
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 21 Feb 2019 16:18:24 +0000 (11:18 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Jul 2019 19:58:24 +0000 (15:58 -0400)
A trace chunk registry is needed by the consumer daemon since there is
no concrete representation of a tracing session object in those
processes.

The trace chunk registry allows the consumer daemon to match
newly-created streams to their current trace chunk. This integration
is performed in a follow-up commit.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/consumer/consumer.c
src/common/consumer/consumer.h

index 9d25d83a341e2c853026f2fb6a4b4a25b10bd2dc..e49ed94d12ca4d37d21294e94ae4f17db25f8d80 100644 (file)
@@ -1245,6 +1245,8 @@ void lttng_consumer_cleanup(void)
         * it.
         */
        lttng_ht_destroy(consumer_data.stream_list_ht);
+
+       lttng_trace_chunk_registry_destroy(consumer_data.chunk_registry);
 }
 
 /*
@@ -3463,6 +3465,11 @@ int lttng_consumer_init(void)
                goto error;
        }
 
+       consumer_data.chunk_registry = lttng_trace_chunk_registry_create();
+       if (!consumer_data.chunk_registry) {
+               goto error;
+       }
+
        return 0;
 
 error:
index 1c1d01de911fee38edcbb3c9c089b0f5a7b11e8c..0c757b84fb3c56b4399afee157d47fe0808b398a 100644 (file)
@@ -34,6 +34,7 @@
 #include <common/sessiond-comm/sessiond-comm.h>
 #include <common/pipe.h>
 #include <common/index/ctf-index.h>
+#include <common/trace-chunk-registry.h>
 
 /* Commands for consumer */
 enum lttng_consumer_command {
@@ -651,6 +652,11 @@ struct lttng_consumer_global_data {
         * This HT uses the "node_channel_id" of the consumer stream.
         */
        struct lttng_ht *stream_per_chan_id_ht;
+
+       /*
+        * Trace chunk registry indexed by (session_id, chunk_id).
+        */
+       struct lttng_trace_chunk_registry *chunk_registry;
 };
 
 /*
This page took 0.027537 seconds and 4 git commands to generate.