From: Jérémie Galarneau Date: Tue, 28 Feb 2017 00:56:23 +0000 (-0500) Subject: Add default lttng sessiond endpoint singleton X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=0c1439656b553c6cd55dc8eb1a41eb45d6727c03 Add default lttng sessiond endpoint singleton Signed-off-by: Jérémie Galarneau --- diff --git a/include/Makefile.am b/include/Makefile.am index bb682205e..32b6f48fe 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -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 index 000000000..de6024b42 --- /dev/null +++ b/include/lttng/endpoint-internal.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2017 - Jérémie Galarneau + * + * 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 +#include + +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 index 000000000..b93ed697e --- /dev/null +++ b/include/lttng/endpoint.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2017 - Jérémie Galarneau + * + * 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 */ diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 966d593dd..5478641b2 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -35,8 +35,6 @@ #include #include -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. * diff --git a/src/lib/lttng-ctl/Makefile.am b/src/lib/lttng-ctl/Makefile.am index 89c84676b..2c3428b7c 100644 --- a/src/lib/lttng-ctl/Makefile.am +++ b/src/lib/lttng-ctl/Makefile.am @@ -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 index 000000000..89066de55 --- /dev/null +++ b/src/lib/lttng-ctl/endpoint.c @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2017 - Jérémie Galarneau + * + * 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 + +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 = + <tng_session_daemon_notification_endpoint_instance;