Add default lttng sessiond endpoint singleton
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 28 Feb 2017 00:56:23 +0000 (19:56 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 1 Mar 2017 04:02:50 +0000 (23:02 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/Makefile.am
include/lttng/endpoint-internal.h [new file with mode: 0644]
include/lttng/endpoint.h [new file with mode: 0644]
include/lttng/lttng.h
src/lib/lttng-ctl/Makefile.am
src/lib/lttng-ctl/endpoint.c [new file with mode: 0644]

index bb682205e4d0cc2746707c3004a3cb55e73336aa..32b6f48fedfe2efa526ced08545a339feaf05874 100644 (file)
@@ -90,4 +90,5 @@ noinst_HEADERS = \
        lttng/condition/buffer-usage-internal.h \
        lttng/condition/evaluation-internal.h \
        lttng/notification/notification-internal.h \
-       lttng/trigger/trigger-internal.h
+       lttng/trigger/trigger-internal.h \
+       lttng/endpoint-internal.h
diff --git a/include/lttng/endpoint-internal.h b/include/lttng/endpoint-internal.h
new file mode 100644 (file)
index 0000000..de6024b
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License, version 2.1 only,
+ * as published by the Free Software Foundation.
+ *
+ * This library 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 Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef LTTNG_ENDPOINT_INTERNAL_H
+#define LTTNG_ENDPOINT_INTERNAL_H
+
+#include <lttng/endpoint.h>
+#include <common/macros.h>
+
+enum lttng_endpoint_type {
+       LTTNG_ENDPOINT_TYPE_DEFAULT_SESSIOND_NOTIFICATION = 0,
+};
+
+struct lttng_endpoint {
+       enum lttng_endpoint_type type;
+};
+
+#endif /* LTTNG_ENDPOINT_INTERNAL_H */
diff --git a/include/lttng/endpoint.h b/include/lttng/endpoint.h
new file mode 100644 (file)
index 0000000..b93ed69
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License, version 2.1 only,
+ * as published by the Free Software Foundation.
+ *
+ * This library 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 Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef LTTNG_ENDPOINT_H
+#define LTTNG_ENDPOINT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Default LTTng session daemon endpoint singleton. */
+extern struct lttng_endpoint *lttng_session_daemon_notification_endpoint;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LTTNG_ENDPOINT_H */
index 966d593dd9c48eb9dd7cebdb8e6ac66bf5b48673..5478641b2eb66f0d6139281c2d4c7a61220f8cd4 100644 (file)
@@ -35,8 +35,6 @@
 #include <lttng/session.h>
 #include <lttng/snapshot.h>
 
-struct lttng_endpoint;
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -57,9 +55,6 @@ struct lttng_calibrate {
        char padding[LTTNG_CALIBRATE_PADDING1];
 };
 
-/* Default LTTng session daemon endpoint. */
-extern struct lttng_endpoint *session_daemon_endpoint;
-
 /*
  * Check if a session daemon is alive.
  *
index 89c84676b481c105c1fe877948c245a4bd64bf2f..2c3428b7c53b02e7744b251013979afe4a071d45 100644 (file)
@@ -7,7 +7,7 @@ lib_LTLIBRARIES = liblttng-ctl.la
 liblttng_ctl_la_SOURCES = lttng-ctl.c snapshot.c lttng-ctl-helper.h \
                lttng-ctl-health.c save.c load.c deprecated-symbols.c \
                action.c notify.c condition.c buffer-usage.c evaluation.c \
-               notification.c trigger.c
+               notification.c trigger.c endpoint.c
 
 liblttng_ctl_la_LDFLAGS = \
                $(LT_NO_UNDEFINED)
diff --git a/src/lib/lttng-ctl/endpoint.c b/src/lib/lttng-ctl/endpoint.c
new file mode 100644 (file)
index 0000000..89066de
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License, version 2.1 only,
+ * as published by the Free Software Foundation.
+ *
+ * This library 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 Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <lttng/endpoint-internal.h>
+
+static
+struct lttng_endpoint lttng_session_daemon_notification_endpoint_instance = {
+       .type = LTTNG_ENDPOINT_TYPE_DEFAULT_SESSIOND_NOTIFICATION
+};
+
+struct lttng_endpoint *lttng_session_daemon_notification_endpoint =
+               &lttng_session_daemon_notification_endpoint_instance;
This page took 0.029267 seconds and 5 git commands to generate.