sessiond-config.h sessiond-config.c \
rotate.h rotate.c \
rotation-thread.h rotation-thread.c \
- timer.c timer.h
+ timer.c timer.h \
+ ready.c \
+ globals.c \
+ thread-utils.c \
+ process-utils.c
if HAVE_LIBLTTNG_UST_CTL
lttng_sessiond_SOURCES += trace-ust.c ust-registry.c ust-app.c \
--- /dev/null
+/*
+ * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * 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.
+ *
+ * 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"
+
+int ust_consumerd64_fd = -1;
+int ust_consumerd32_fd = -1;
+
+long page_size;
+
+struct health_app *health_sessiond;
+
+struct notification_thread_handle *notification_thread_handle;
+
+struct lttng_ht *agent_apps_ht_by_sock = NULL;
+
+int kernel_tracer_fd = -1;
+
+int apps_cmd_notify_pipe[2] = { -1, -1 };
+
+pid_t ppid;
+pid_t child_ppid;
+
+struct sessiond_config config;
/* Set in main.c at boot time of the daemon */
extern int kernel_tracer_fd;
+/* Notification thread handle. */
extern struct notification_thread_handle *notification_thread_handle;
/*
/*
* Populated when the daemon starts with the current page size of the system.
+ * Set in main() with the current page size.
*/
extern long page_size;
/* Application health monitoring */
extern struct health_app *health_sessiond;
-/*
- * Section name to look for in the daemon configuration file.
- */
-extern const char * const config_section_name;
+extern struct sessiond_config config;
-/* Is this daemon root or not. */
-extern int is_root;
+extern int lttng_sessiond_ready;
-extern struct sessiond_config config;
+extern int ust_consumerd64_fd, ust_consumerd32_fd;
+
+/* Parent PID for --sig-parent option */
+extern pid_t ppid;
+/* Internal parent PID use with daemonize. */
+extern pid_t child_ppid;
+int sessiond_init_thread_quit_pipe(void);
int sessiond_check_thread_quit_pipe(int fd, uint32_t events);
+int sessiond_wait_for_quit_pipe(unsigned int timeout_us);
+int sessiond_notify_quit_pipe(void);
+void sessiond_close_quit_pipe(void);
+
int sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size);
void sessiond_notify_ready(void);
void sessiond_signal_parents(void);
;
const char *progname;
-static pid_t ppid; /* Parent PID for --sig-parent option */
-static pid_t child_ppid; /* Internal parent PID use with daemonize. */
static int lockfile_fd = -1;
/* Set to 1 when a SIGUSR1 signal is received. */
{ NULL, 0, 0, 0 }
};
-struct sessiond_config config;
-
/* Command line options to ignore from configuration file */
static const char *config_ignore_options[] = { "help", "version", "config" };
/* Sockets and FDs */
static int client_sock = -1;
static int apps_sock = -1;
-int kernel_tracer_fd = -1;
static int kernel_poll_pipe[2] = { -1, -1 };
-/*
- * Quit pipe for all threads. This permits a single cancellation point
- * for all threads when receiving an event on the pipe.
- */
-static int thread_quit_pipe[2] = { -1, -1 };
-
/*
* This pipe is used to inform the thread managing application communication
* that a command is queued and ready to be processed.
*/
static int apps_cmd_pipe[2] = { -1, -1 };
-int apps_cmd_notify_pipe[2] = { -1, -1 };
-
/* Pthread, Mutexes and Semaphores */
static pthread_t apps_thread;
static pthread_t apps_notify_thread;
*/
static struct ltt_session_list *session_list_ptr;
-int ust_consumerd64_fd = -1;
-int ust_consumerd32_fd = -1;
-
static const char *module_proc_lttng = "/proc/lttng";
/*
static enum consumerd_state ust_consumerd_state;
static enum consumerd_state kernel_consumerd_state;
-/* Set in main() with the current page size. */
-long page_size;
-
-/* Application health monitoring */
-struct health_app *health_sessiond;
-
-/* Am I root or not. */
-int is_root; /* Set to 1 if the daemon is running as root */
-
-const char * const config_section_name = "sessiond";
-
/* Load session thread information to operate. */
-struct load_session_thread_data *load_info;
-
-/* Notification thread handle. */
-struct notification_thread_handle *notification_thread_handle;
-
-/* Rotation thread handle. */
-struct rotation_thread_handle *rotation_thread_handle;
-
-/* Global hash tables */
-struct lttng_ht *agent_apps_ht_by_sock = NULL;
+static struct load_session_thread_data *load_info;
/*
- * The initialization of the session daemon is done in multiple phases.
- *
- * While all threads are launched near-simultaneously, only some of them
- * are needed to ensure the session daemon can start to respond to client
- * requests.
- *
- * There are two important guarantees that we wish to offer with respect
- * to the initialisation of the session daemon:
- * - When the daemonize/background launcher process exits, the sessiond
- * is fully able to respond to client requests,
- * - Auto-loaded sessions are visible to clients.
- *
- * In order to achieve this, a number of support threads have to be launched
- * to allow the "client" thread to function properly. Moreover, since the
- * "load session" thread needs the client thread, we must provide a way
- * for the "load session" thread to know that the "client" thread is up
- * and running.
- *
- * Hence, the support threads decrement the lttng_sessiond_ready counter
- * while the "client" threads waits for it to reach 0. Once the "client" thread
- * unblocks, it posts the message_thread_ready semaphore which allows the
- * "load session" thread to progress.
- *
- * This implies that the "load session" thread is the last to be initialized
- * and will explicitly call sessiond_signal_parents(), which signals the parents
- * that the session daemon is fully initialized.
- *
- * The four (4) support threads are:
- * - agent_thread
- * - notification_thread
- * - rotation_thread
- * - health_thread
+ * Section name to look for in the daemon configuration file.
*/
-#define NR_LTTNG_SESSIOND_SUPPORT_THREADS 4
-int lttng_sessiond_ready = NR_LTTNG_SESSIOND_SUPPORT_THREADS;
-
-int sessiond_check_thread_quit_pipe(int fd, uint32_t events)
-{
- return (fd == thread_quit_pipe[0] && (events & LPOLLIN)) ? 1 : 0;
-}
+static const char * const config_section_name = "sessiond";
-/* Notify parents that we are ready for cmd and health check */
-LTTNG_HIDDEN
-void sessiond_signal_parents(void)
-{
- /*
- * Notify parent pid that we are ready to accept command
- * for client side. This ppid is the one from the
- * external process that spawned us.
- */
- if (config.sig_parent) {
- kill(ppid, SIGUSR1);
- }
-
- /*
- * Notify the parent of the fork() process that we are
- * ready.
- */
- if (config.daemonize || config.background) {
- kill(child_ppid, SIGUSR1);
- }
-}
-
-LTTNG_HIDDEN
-void sessiond_notify_ready(void)
-{
- /*
- * This memory barrier is paired with the one performed by
- * the client thread after it has seen that 'lttng_sessiond_ready' is 0.
- *
- * The purpose of these memory barriers is to ensure that all
- * initialization operations of the various threads that call this
- * function to signal that they are ready are commited/published
- * before the client thread can see the 'lttng_sessiond_ready' counter
- * reach 0.
- *
- * Note that this could be a 'write' memory barrier, but a full barrier
- * is used in case the code using this utility changes. The performance
- * implications of this choice are minimal since this is a slow path.
- */
- cmm_smp_mb();
- uatomic_sub(<tng_sessiond_ready, 1);
-}
-
-static
-int __sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size,
- int *a_pipe)
-{
- int ret;
+/* Am I root or not. Set to 1 if the daemon is running as root */
+static int is_root;
- assert(events);
-
- ret = lttng_poll_create(events, size, LTTNG_CLOEXEC);
- if (ret < 0) {
- goto error;
- }
-
- /* Add quit pipe */
- ret = lttng_poll_add(events, a_pipe[0], LPOLLIN | LPOLLERR);
- if (ret < 0) {
- goto error;
- }
-
- return 0;
-
-error:
- return ret;
-}
-
-/*
- * Create a poll set with O_CLOEXEC and add the thread quit pipe to the set.
- */
-int sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size)
-{
- return __sessiond_set_thread_pollset(events, size, thread_quit_pipe);
-}
-
-/*
- * Init thread quit pipe.
- *
- * Return -1 on error or 0 if all pipes are created.
- */
-static int __init_thread_quit_pipe(int *a_pipe)
-{
- int ret, i;
-
- ret = pipe(a_pipe);
- if (ret < 0) {
- PERROR("thread quit pipe");
- goto error;
- }
-
- for (i = 0; i < 2; i++) {
- ret = fcntl(a_pipe[i], F_SETFD, FD_CLOEXEC);
- if (ret < 0) {
- PERROR("fcntl");
- goto error;
- }
- }
-
-error:
- return ret;
-}
-
-static int init_thread_quit_pipe(void)
-{
- return __init_thread_quit_pipe(thread_quit_pipe);
-}
+/* Rotation thread handle. */
+static struct rotation_thread_handle *rotation_thread_handle;
/*
* Stop all threads by closing the thread quit pipe.
/* Stopping all threads */
DBG("Terminating all threads");
- ret = notify_thread_pipe(thread_quit_pipe[1]);
+ ret = sessiond_notify_quit_pipe();
if (ret < 0) {
ERR("write error on thread quit pipe");
}
* Close the thread quit pipe. It has already done its job,
* since we are now called.
*/
- utils_close_pipe(thread_quit_pipe);
+ sessiond_close_quit_pipe();
ret = remove(config.pid_file_path.value);
if (ret < 0) {
* commands.
*/
while (uatomic_read(<tng_sessiond_ready) != 0) {
- fd_set read_fds;
- struct timeval timeout;
-
- FD_ZERO(&read_fds);
- FD_SET(thread_quit_pipe[0], &read_fds);
- memset(&timeout, 0, sizeof(timeout));
- timeout.tv_usec = 1000;
-
/*
* If a support thread failed to launch, it may signal that
* we must exit and the sessiond would never be marked as
* The timeout is set to 1ms, which serves as a way to
* pace down this check.
*/
- ret = select(thread_quit_pipe[0] + 1, &read_fds, NULL, NULL,
- &timeout);
- if (ret > 0 || (ret < 0 && errno != EINTR)) {
+ ret = sessiond_wait_for_quit_pipe(1000);
+ if (ret > 0) {
goto exit;
}
}
}
/* Create thread quit pipe */
- if (init_thread_quit_pipe()) {
+ if (sessiond_init_thread_quit_pipe()) {
retval = -1;
goto exit_init_data;
}
/* rotation_thread_data acquires the pipes' read side. */
rotation_thread_handle = rotation_thread_handle_create(
- thread_quit_pipe[0],
rotation_timer_queue,
notification_thread_handle,
¬ification_thread_ready);
--- /dev/null
+/*
+ * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * 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.
+ *
+ * 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 <signal.h>
+#include "lttng-sessiond.h"
+
+/* Notify parents that we are ready for cmd and health check */
+void sessiond_signal_parents(void)
+{
+ /*
+ * Notify parent pid that we are ready to accept command
+ * for client side. This ppid is the one from the
+ * external process that spawned us.
+ */
+ if (config.sig_parent) {
+ kill(ppid, SIGUSR1);
+ }
+
+ /*
+ * Notify the parent of the fork() process that we are
+ * ready.
+ */
+ if (config.daemonize || config.background) {
+ kill(child_ppid, SIGUSR1);
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * 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.
+ *
+ * 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 <common/macros.h>
+#include <urcu.h>
+#include "lttng-sessiond.h"
+
+/*
+ * The initialization of the session daemon is done in multiple phases.
+ *
+ * While all threads are launched near-simultaneously, only some of them
+ * are needed to ensure the session daemon can start to respond to client
+ * requests.
+ *
+ * There are two important guarantees that we wish to offer with respect
+ * to the initialisation of the session daemon:
+ * - When the daemonize/background launcher process exits, the sessiond
+ * is fully able to respond to client requests,
+ * - Auto-loaded sessions are visible to clients.
+ *
+ * In order to achieve this, a number of support threads have to be launched
+ * to allow the "client" thread to function properly. Moreover, since the
+ * "load session" thread needs the client thread, we must provide a way
+ * for the "load session" thread to know that the "client" thread is up
+ * and running.
+ *
+ * Hence, the support threads decrement the lttng_sessiond_ready counter
+ * while the "client" threads waits for it to reach 0. Once the "client" thread
+ * unblocks, it posts the message_thread_ready semaphore which allows the
+ * "load session" thread to progress.
+ *
+ * This implies that the "load session" thread is the last to be initialized
+ * and will explicitly call sessiond_signal_parents(), which signals the parents
+ * that the session daemon is fully initialized.
+ *
+ * The four (4) support threads are:
+ * - agent_thread
+ * - notification_thread
+ * - rotation_thread
+ * - health_thread
+ */
+#define NR_LTTNG_SESSIOND_SUPPORT_THREADS 4
+int lttng_sessiond_ready = NR_LTTNG_SESSIOND_SUPPORT_THREADS;
+
+LTTNG_HIDDEN
+void sessiond_notify_ready(void)
+{
+ /*
+ * This memory barrier is paired with the one performed by
+ * the client thread after it has seen that 'lttng_sessiond_ready' is 0.
+ *
+ * The purpose of these memory barriers is to ensure that all
+ * initialization operations of the various threads that call this
+ * function to signal that they are ready are commited/published
+ * before the client thread can see the 'lttng_sessiond_ready' counter
+ * reach 0.
+ *
+ * Note that this could be a 'write' memory barrier, but a full barrier
+ * is used in case the code using this utility changes. The performance
+ * implications of this choice are minimal since this is a slow path.
+ */
+ cmm_smp_mb();
+ uatomic_sub(<tng_sessiond_ready, 1);
+}
};
struct rotation_thread_handle {
- int quit_pipe;
struct rotation_thread_timer_queue *rotation_timer_queue;
/* Access to the notification thread cmd_queue */
struct notification_thread_handle *notification_thread_handle;
}
struct rotation_thread_handle *rotation_thread_handle_create(
- int quit_pipe,
struct rotation_thread_timer_queue *rotation_timer_queue,
struct notification_thread_handle *notification_thread_handle,
sem_t *notification_thread_ready)
goto end;
}
- handle->quit_pipe = quit_pipe;
handle->rotation_timer_queue = rotation_timer_queue;
handle->notification_thread_handle = notification_thread_handle;
handle->notification_thread_ready = notification_thread_ready;
* - quit pipe,
* - rotation thread timer queue pipe,
*/
- ret = lttng_poll_create(poll_set, 2, LTTNG_CLOEXEC);
- if (ret < 0) {
- goto end;
- }
-
- ret = lttng_poll_add(poll_set, handle->quit_pipe,
- LPOLLIN | LPOLLERR);
- if (ret < 0) {
- ERR("[rotation-thread] Failed to add quit_pipe fd to pollset");
+ ret = sessiond_set_thread_pollset(poll_set, 2);
+ if (ret) {
goto error;
}
ret = lttng_poll_add(poll_set,
goto error;
}
-end:
return ret;
error:
lttng_poll_clean(poll_set);
goto error;
}
- if (fd == handle->quit_pipe) {
+ if (sessiond_check_thread_quit_pipe(fd, revents)) {
DBG("[rotation-thread] Quit pipe activity");
/* TODO flush the queue. */
goto exit;
struct rotation_thread_timer_queue *queue);
struct rotation_thread_handle *rotation_thread_handle_create(
- int thread_quit_pipe,
struct rotation_thread_timer_queue *rotation_timer_queue,
struct notification_thread_handle *notification_thread_handle,
sem_t *notification_thread_ready);
#include "session.h"
#include "utils.h"
#include "trace-ust.h"
+#include "timer.h"
/*
* NOTES:
--- /dev/null
+/*
+ * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * 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.
+ *
+ * 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 "utils.h"
+#include <common/utils.h>
+
+/*
+ * Quit pipe for all threads. This permits a single cancellation point
+ * for all threads when receiving an event on the pipe.
+ */
+static int thread_quit_pipe[2] = { -1, -1 };
+
+/*
+ * Init thread quit pipe.
+ *
+ * Return -1 on error or 0 if all pipes are created.
+ */
+static int __init_thread_quit_pipe(int *a_pipe)
+{
+ int ret, i;
+
+ ret = pipe(a_pipe);
+ if (ret < 0) {
+ PERROR("thread quit pipe");
+ goto error;
+ }
+
+ for (i = 0; i < 2; i++) {
+ ret = fcntl(a_pipe[i], F_SETFD, FD_CLOEXEC);
+ if (ret < 0) {
+ PERROR("fcntl");
+ goto error;
+ }
+ }
+
+error:
+ return ret;
+}
+
+int sessiond_init_thread_quit_pipe(void)
+{
+ return __init_thread_quit_pipe(thread_quit_pipe);
+}
+
+int sessiond_check_thread_quit_pipe(int fd, uint32_t events)
+{
+ return (fd == thread_quit_pipe[0] && (events & LPOLLIN));
+}
+
+/*
+ * Wait for a notification on the quit pipe (with a timeout).
+ *
+ * Returns 1 if the caller should quit, 0 if the timeout was reached, and
+ * -1 if an error was encountered.
+ */
+int sessiond_wait_for_quit_pipe(unsigned int timeout_us)
+{
+ int ret;
+ fd_set read_fds;
+ struct timeval timeout;
+
+ FD_ZERO(&read_fds);
+ FD_SET(thread_quit_pipe[0], &read_fds);
+ memset(&timeout, 0, sizeof(timeout));
+ timeout.tv_usec = timeout_us;
+
+ while (true) {
+ ret = select(thread_quit_pipe[0] + 1, &read_fds, NULL, NULL,
+ &timeout);
+ if (ret < 0 && errno == EINTR) {
+ /* Retry on interrupt. */
+ continue;
+ } else {
+ break;
+ }
+ }
+
+ if (ret > 0) {
+ /* Should quit. */
+ ret = 1;
+ } else if (ret < 0 && errno != EINTR) {
+ /* Unknown error. */
+ PERROR("Failed to select() thread quit pipe");
+ ret = -1;
+ } else {
+ /* Timeout reached. */
+ ret = 0;
+ }
+
+ return ret;
+}
+
+int sessiond_notify_quit_pipe(void)
+{
+ return notify_thread_pipe(thread_quit_pipe[1]);
+}
+
+void sessiond_close_quit_pipe(void)
+{
+ utils_close_pipe(thread_quit_pipe);
+}
+
+static
+int __sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size,
+ int *a_pipe)
+{
+ int ret;
+
+ assert(events);
+
+ ret = lttng_poll_create(events, size, LTTNG_CLOEXEC);
+ if (ret < 0) {
+ goto error;
+ }
+
+ /* Add quit pipe */
+ ret = lttng_poll_add(events, a_pipe[0], LPOLLIN | LPOLLERR);
+ if (ret < 0) {
+ goto error;
+ }
+
+ return 0;
+
+error:
+ return ret;
+}
+
+/*
+ * Create a poll set with O_CLOEXEC and add the thread quit pipe to the set.
+ */
+int sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size)
+{
+ return __sessiond_set_thread_pollset(events, size, thread_quit_pipe);
+}
LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la
LIBHEALTH=$(top_builddir)/src/common/health/libhealth.la
-LIVE=$(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
+LIVE= $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
$(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
$(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT)
#include <lttng/lttng.h>
#include <urcu/list.h>
-#include <bin/lttng-sessiond/session.h>
#include <common/common.h>
#include <bin/lttng-relayd/lttng-viewer-abi.h>
test_uri_SOURCES = test_uri.c
test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) $(DL_LIBS)
-# Session unit test
-SESSIONS=$(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
+# Sessiond objects
+SESSIOND_OBJS = $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/load-session-thread.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/cmd.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/save.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/shm.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/kernel.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/ht-cleanup.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/notification-thread.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/lttng-syscall.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/channel.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/agent.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/ready.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/kernel-consumer.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/rotation-thread.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/context.$(OBJEXT) \
$(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
$(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/fd-limit.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/notification-thread-events.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/event.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/timer.$(OBJEXT) \
$(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/ht-cleanup.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/sessiond-config.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/rotate.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/modprobe.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/globals.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/thread-utils.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/process-utils.$(OBJEXT) \
$(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/common/testpoint/libtestpoint.la \
$(top_builddir)/src/common/compat/libcompat.la \
$(top_builddir)/src/common/health/libhealth.la \
$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
+if HAVE_LIBLTTNG_UST_CTL
+SESSIOND_OBJS += $(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/ust-registry.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/ust-app.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/ust-consumer.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/ust-thread.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/agent-thread.$(OBJEXT) \
+ $(top_builddir)/src/bin/lttng-sessiond/ust-field-utils.$(OBJEXT)
+endif
test_session_SOURCES = test_session.c
test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
- $(LIBHASHTABLE) $(DL_LIBS) -lrt
-test_session_LDADD += $(SESSIONS)
+ $(LIBHASHTABLE) $(DL_LIBS) -lrt -lurcu-common -lurcu \
+ $(KMOD_LIBS) \
+ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
+ $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
+ $(top_builddir)/src/common/compat/libcompat.la \
+ $(top_builddir)/src/common/testpoint/libtestpoint.la \
+ $(top_builddir)/src/common/health/libhealth.la \
+ $(top_builddir)/src/common/config/libconfig.la \
+ $(top_builddir)/src/common/string-utils/libstring-utils.la
+
+test_session_LDADD += $(SESSIOND_OBJS)
-# UST data structures unit test
if HAVE_LIBLTTNG_UST_CTL
-UST_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/ust-registry.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/ust-field-utils.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/ust-app.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/ust-consumer.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/fd-limit.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/agent.$(OBJEXT) \
- $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
- $(top_builddir)/src/common/libcommon.la \
- $(top_builddir)/src/common/health/libhealth.la \
- $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
+test_session_LDADD += -llttng-ust-ctl
+endif
+# UST data structures unit test
+if HAVE_LIBLTTNG_UST_CTL
test_ust_data_SOURCES = test_ust_data.c
-test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM)\
- $(LIBHASHTABLE) $(DL_LIBS) -lrt -llttng-ust-ctl
-test_ust_data_LDADD += $(UST_DATA_TRACE)
+test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
+ $(LIBHASHTABLE) $(DL_LIBS) -lrt -lurcu-common -lurcu \
+ -llttng-ust-ctl \
+ $(KMOD_LIBS) \
+ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
+ $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
+ $(top_builddir)/src/common/compat/libcompat.la \
+ $(top_builddir)/src/common/testpoint/libtestpoint.la \
+ $(top_builddir)/src/common/health/libhealth.la \
+ $(top_builddir)/src/common/config/libconfig.la \
+ $(top_builddir)/src/common/string-utils/libstring-utils.la
+test_ust_data_LDADD += $(SESSIOND_OBJS)
endif
# Kernel data structures unit test