2 * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 * SPDX-License-Identifier: GPL-2.0-only
10 #include "lttng-sessiond.h"
11 #include <common/uuid.h>
13 lttng_uuid the_sessiond_uuid
;
15 int the_ust_consumerd64_fd
= -1;
16 int the_ust_consumerd32_fd
= -1;
20 struct health_app
*the_health_sessiond
;
22 struct notification_thread_handle
*the_notification_thread_handle
;
24 struct lttng_ht
*the_agent_apps_ht_by_sock
= NULL
;
25 struct lttng_ht
*the_trigger_agents_ht_by_domain
= NULL
;
27 struct lttng_kernel_tracer_version the_kernel_tracer_version
;
28 struct lttng_kernel_tracer_abi_version the_kernel_tracer_abi_version
;
30 int the_kernel_poll_pipe
[2] = {-1, -1};
35 struct sessiond_config the_config
;
37 struct consumer_data the_kconsumer_data
= {
38 .type
= LTTNG_CONSUMER_KERNEL
,
41 .channel_monitor_pipe
= -1,
42 .pid_mutex
= PTHREAD_MUTEX_INITIALIZER
,
43 .lock
= PTHREAD_MUTEX_INITIALIZER
,
46 struct consumer_data the_ustconsumer64_data
= {
47 .type
= LTTNG_CONSUMER64_UST
,
50 .channel_monitor_pipe
= -1,
51 .pid_mutex
= PTHREAD_MUTEX_INITIALIZER
,
52 .lock
= PTHREAD_MUTEX_INITIALIZER
,
55 struct consumer_data the_ustconsumer32_data
= {
56 .type
= LTTNG_CONSUMER32_UST
,
59 .channel_monitor_pipe
= -1,
60 .pid_mutex
= PTHREAD_MUTEX_INITIALIZER
,
61 .lock
= PTHREAD_MUTEX_INITIALIZER
,
64 enum consumerd_state the_ust_consumerd_state
;
65 enum consumerd_state the_kernel_consumerd_state
;
67 static void __attribute__((constructor
)) init_sessiond_uuid(void)
69 if (lttng_uuid_generate(the_sessiond_uuid
)) {
70 ERR("Failed to generate a session daemon UUID");