2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
3 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * 2013 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "lttng-sessiond.h"
21 #include <common/compat/uuid.h>
23 lttng_uuid sessiond_uuid
;
25 int ust_consumerd64_fd
= -1;
26 int ust_consumerd32_fd
= -1;
30 struct health_app
*health_sessiond
;
32 struct notification_thread_handle
*notification_thread_handle
;
34 struct lttng_ht
*agent_apps_ht_by_sock
= NULL
;
36 int kernel_tracer_fd
= -1;
37 struct lttng_kernel_tracer_version kernel_tracer_version
;
38 struct lttng_kernel_tracer_abi_version kernel_tracer_abi_version
;
40 int kernel_poll_pipe
[2] = { -1, -1 };
45 struct sessiond_config config
;
47 struct consumer_data kconsumer_data
= {
48 .type
= LTTNG_CONSUMER_KERNEL
,
51 .channel_monitor_pipe
= -1,
52 .pid_mutex
= PTHREAD_MUTEX_INITIALIZER
,
53 .lock
= PTHREAD_MUTEX_INITIALIZER
,
56 struct consumer_data ustconsumer64_data
= {
57 .type
= LTTNG_CONSUMER64_UST
,
60 .channel_monitor_pipe
= -1,
61 .pid_mutex
= PTHREAD_MUTEX_INITIALIZER
,
62 .lock
= PTHREAD_MUTEX_INITIALIZER
,
65 struct consumer_data ustconsumer32_data
= {
66 .type
= LTTNG_CONSUMER32_UST
,
69 .channel_monitor_pipe
= -1,
70 .pid_mutex
= PTHREAD_MUTEX_INITIALIZER
,
71 .lock
= PTHREAD_MUTEX_INITIALIZER
,
74 enum consumerd_state ust_consumerd_state
;
75 enum consumerd_state kernel_consumerd_state
;
77 static void __attribute__((constructor
)) init_sessiond_uuid(void)
79 if (lttng_uuid_generate(sessiond_uuid
)) {
80 ERR("Failed to generate a session daemon UUID");