SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / src / bin / lttng-sessiond / globals.c
index 6ca5a5a712901328d53e078cc0391b42680168d4..8681d5d90749d84c5745015d52334f4c65a1bb18 100644 (file)
@@ -1,23 +1,16 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
- *                      Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *               2013 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include "lttng-sessiond.h"
+#include <common/uuid.h>
+
+lttng_uuid sessiond_uuid;
 
 int ust_consumerd64_fd = -1;
 int ust_consumerd32_fd = -1;
@@ -27,10 +20,11 @@ long page_size;
 struct health_app *health_sessiond;
 
 struct notification_thread_handle *notification_thread_handle;
+pthread_mutex_t notification_trigger_tokens_ht_lock = PTHREAD_MUTEX_INITIALIZER;
 
 struct lttng_ht *agent_apps_ht_by_sock = NULL;
+struct lttng_ht *trigger_agents_ht_by_domain = NULL;
 
-int kernel_tracer_fd = -1;
 struct lttng_kernel_tracer_version kernel_tracer_version;
 struct lttng_kernel_tracer_abi_version kernel_tracer_abi_version;
 
@@ -48,8 +42,6 @@ struct consumer_data kconsumer_data = {
        .channel_monitor_pipe = -1,
        .pid_mutex = PTHREAD_MUTEX_INITIALIZER,
        .lock = PTHREAD_MUTEX_INITIALIZER,
-       .cond = PTHREAD_COND_INITIALIZER,
-       .cond_mutex = PTHREAD_MUTEX_INITIALIZER,
 };
 
 struct consumer_data ustconsumer64_data = {
@@ -59,8 +51,6 @@ struct consumer_data ustconsumer64_data = {
        .channel_monitor_pipe = -1,
        .pid_mutex = PTHREAD_MUTEX_INITIALIZER,
        .lock = PTHREAD_MUTEX_INITIALIZER,
-       .cond = PTHREAD_COND_INITIALIZER,
-       .cond_mutex = PTHREAD_MUTEX_INITIALIZER,
 };
 
 struct consumer_data ustconsumer32_data = {
@@ -70,9 +60,15 @@ struct consumer_data ustconsumer32_data = {
        .channel_monitor_pipe = -1,
        .pid_mutex = PTHREAD_MUTEX_INITIALIZER,
        .lock = PTHREAD_MUTEX_INITIALIZER,
-       .cond = PTHREAD_COND_INITIALIZER,
-       .cond_mutex = PTHREAD_MUTEX_INITIALIZER,
 };
 
 enum consumerd_state ust_consumerd_state;
 enum consumerd_state kernel_consumerd_state;
+
+static void __attribute__((constructor)) init_sessiond_uuid(void)
+{
+       if (lttng_uuid_generate(sessiond_uuid)) {
+               ERR("Failed to generate a session daemon UUID");
+               abort();
+       }
+}
This page took 0.024726 seconds and 5 git commands to generate.