X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer.cpp;h=a5691b1c27df6deec93703bdc38d19121d3e237b;hb=328c2fe7297c941aa9cbcfa4ce944fca1bd7300f;hp=9393e6cc29af21a8c3b8072ffd42eb6a0ae14b3e;hpb=64803277bbdbe0a943360d918298a48157d9da55;p=lttng-tools.git diff --git a/src/common/consumer/consumer.cpp b/src/common/consumer/consumer.cpp index 9393e6cc2..a5691b1c2 100644 --- a/src/common/consumer/consumer.cpp +++ b/src/common/consumer/consumer.cpp @@ -52,12 +52,22 @@ enum consumer_channel_action { CONSUMER_CHANNEL_QUIT, }; +namespace { struct consumer_channel_msg { enum consumer_channel_action action; struct lttng_consumer_channel *chan; /* add */ uint64_t key; /* del */ }; +/* + * Global hash table containing respectively metadata and data streams. The + * stream element in this ht should only be updated by the metadata poll thread + * for the metadata and the data poll thread for the data. + */ +struct lttng_ht *metadata_ht; +struct lttng_ht *data_ht; +} /* namespace */ + /* Flag used to temporarily pause data consumption from testpoints. */ int data_consumption_paused; @@ -69,14 +79,6 @@ int data_consumption_paused; */ int consumer_quit; -/* - * Global hash table containing respectively metadata and data streams. The - * stream element in this ht should only be updated by the metadata poll thread - * for the metadata and the data poll thread for the data. - */ -static struct lttng_ht *metadata_ht; -static struct lttng_ht *data_ht; - static const char *get_consumer_domain(void) { switch (the_consumer_data.type) { @@ -4695,7 +4697,7 @@ end: enum lttcomm_return_code lttng_consumer_init_command( struct lttng_consumer_local_data *ctx, - const lttng_uuid sessiond_uuid) + const lttng_uuid& sessiond_uuid) { enum lttcomm_return_code ret; char uuid_str[LTTNG_UUID_STR_LEN]; @@ -4706,7 +4708,7 @@ enum lttcomm_return_code lttng_consumer_init_command( } ctx->sessiond_uuid.is_set = true; - memcpy(ctx->sessiond_uuid.value, sessiond_uuid, sizeof(lttng_uuid)); + ctx->sessiond_uuid.value = sessiond_uuid; ret = LTTCOMM_CONSUMERD_SUCCESS; lttng_uuid_to_str(sessiond_uuid, uuid_str); DBG("Received session daemon UUID: %s", uuid_str);