From: Jérémie Galarneau Date: Thu, 21 Feb 2019 16:18:24 +0000 (-0500) Subject: Create a consumer daemon trace chunk registry on launch X-Git-Tag: v2.11.0-rc3~142 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a335e585966bda8c17b442eab3f0792220821b8f;p=lttng-tools.git Create a consumer daemon trace chunk registry on launch 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 --- diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 9d25d83a3..e49ed94d1 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -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: diff --git a/src/common/consumer/consumer.h b/src/common/consumer/consumer.h index 1c1d01de9..0c757b84f 100644 --- a/src/common/consumer/consumer.h +++ b/src/common/consumer/consumer.h @@ -34,6 +34,7 @@ #include #include #include +#include /* 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; }; /*