From 28cc88f3d462587c4fe37497b728fdb7cbc73e97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 21 Feb 2019 11:18:24 -0500 Subject: [PATCH] Create a consumer daemon trace chunk registry on launch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/consumer/consumer.c | 7 +++++++ src/common/consumer/consumer.h | 6 ++++++ 2 files changed, 13 insertions(+) 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; }; /* -- 2.34.1