Fix: Close socket handle on error
[lttng-tools.git] / src / bin / lttng-sessiond / globals.c
CommitLineData
51bb4dbb
JG
1/*
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>
5 *
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.
9 *
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.
14 *
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.
18 */
19
20#include "lttng-sessiond.h"
3438f6f5
JG
21#include <common/compat/uuid.h>
22
23lttng_uuid sessiond_uuid;
51bb4dbb
JG
24
25int ust_consumerd64_fd = -1;
26int ust_consumerd32_fd = -1;
27
28long page_size;
29
30struct health_app *health_sessiond;
31
32struct notification_thread_handle *notification_thread_handle;
33
34struct lttng_ht *agent_apps_ht_by_sock = NULL;
35
050e613c
JG
36struct lttng_kernel_tracer_version kernel_tracer_version;
37struct lttng_kernel_tracer_abi_version kernel_tracer_abi_version;
51bb4dbb 38
48a86f68 39int kernel_poll_pipe[2] = { -1, -1 };
51bb4dbb
JG
40
41pid_t ppid;
42pid_t child_ppid;
43
44struct sessiond_config config;
050e613c
JG
45
46struct consumer_data kconsumer_data = {
47 .type = LTTNG_CONSUMER_KERNEL,
48 .err_sock = -1,
49 .cmd_sock = -1,
50 .channel_monitor_pipe = -1,
51 .pid_mutex = PTHREAD_MUTEX_INITIALIZER,
52 .lock = PTHREAD_MUTEX_INITIALIZER,
050e613c
JG
53};
54
55struct consumer_data ustconsumer64_data = {
56 .type = LTTNG_CONSUMER64_UST,
57 .err_sock = -1,
58 .cmd_sock = -1,
59 .channel_monitor_pipe = -1,
60 .pid_mutex = PTHREAD_MUTEX_INITIALIZER,
61 .lock = PTHREAD_MUTEX_INITIALIZER,
050e613c
JG
62};
63
64struct consumer_data ustconsumer32_data = {
65 .type = LTTNG_CONSUMER32_UST,
66 .err_sock = -1,
67 .cmd_sock = -1,
68 .channel_monitor_pipe = -1,
69 .pid_mutex = PTHREAD_MUTEX_INITIALIZER,
70 .lock = PTHREAD_MUTEX_INITIALIZER,
050e613c
JG
71};
72
73enum consumerd_state ust_consumerd_state;
74enum consumerd_state kernel_consumerd_state;
3438f6f5
JG
75
76static void __attribute__((constructor)) init_sessiond_uuid(void)
77{
78 if (lttng_uuid_generate(sessiond_uuid)) {
79 ERR("Failed to generate a session daemon UUID");
80 abort();
81 }
82}
This page took 0.056985 seconds and 4 git commands to generate.