cmd-2-2.c cmd-2-2.h \
cmd-2-4.c cmd-2-4.h \
health-relayd.c health-relayd.h \
- lttng-viewer.h
+ lttng-viewer.h testpoint.h
# link on liblttngctl for check if relayd is already alive.
lttng_relayd_LDADD = -lrt -lurcu-common -lurcu \
$(top_builddir)/src/common/compat/libcompat.la \
$(top_builddir)/src/common/index/libindex.la \
$(top_builddir)/src/common/health/libhealth.la \
- $(top_builddir)/src/common/config/libconfig.la
+ $(top_builddir)/src/common/config/libconfig.la \
+ $(top_builddir)/src/common/testpoint/libtestpoint.la
#include "lttng-viewer.h"
#include "utils.h"
#include "health-relayd.h"
+#include "testpoint.h"
static struct lttng_uri *live_uri;
lttng_relay_notify_ready();
+ if (testpoint(relayd_thread_live_listener)) {
+ goto error_testpoint;
+ }
+
while (1) {
health_code_update();
exit:
error:
error_poll_add:
+error_testpoint:
lttng_poll_clean(&events);
error_create_poll:
if (live_control_sock->fd >= 0) {
health_register(health_relayd, HEALTH_RELAYD_TYPE_LIVE_DISPATCHER);
+ if (testpoint(relayd_thread_live_dispatcher)) {
+ goto error_testpoint;
+ }
+
health_code_update();
while (!CMM_LOAD_SHARED(live_dispatch_thread_exit)) {
err = 0;
error:
+error_testpoint:
if (err) {
health_error();
ERR("Health error occurred in %s", __func__);
health_register(health_relayd, HEALTH_RELAYD_TYPE_LIVE_WORKER);
+ if (testpoint(relayd_thread_live_worker)) {
+ goto error_testpoint;
+ }
+
/* table of connections indexed on socket */
relay_connections_ht = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
if (!relay_connections_ht) {
DBG("Viewer worker thread exited with error");
}
DBG("Viewer worker thread cleanup complete");
+error_testpoint:
if (err) {
health_error();
ERR("Health error occurred in %s", __func__);
#include "lttng-relayd.h"
#include "live.h"
#include "health-relayd.h"
+#include "testpoint.h"
/* command line options */
char *opt_output_path;
lttng_relay_notify_ready();
+ if (testpoint(relayd_thread_listener)) {
+ goto error_testpoint;
+ }
+
while (1) {
health_code_update();
exit:
error:
error_poll_add:
+error_testpoint:
lttng_poll_clean(&events);
error_create_poll:
if (data_sock->fd >= 0) {
health_register(health_relayd, HEALTH_RELAYD_TYPE_DISPATCHER);
+ if (testpoint(relayd_thread_dispatcher)) {
+ goto error_testpoint;
+ }
+
health_code_update();
while (!CMM_LOAD_SHARED(dispatch_thread_exit)) {
err = 0;
error:
+error_testpoint:
if (err) {
health_error();
ERR("Health error occurred in %s", __func__);
health_register(health_relayd, HEALTH_RELAYD_TYPE_WORKER);
+ if (testpoint(relayd_thread_worker)) {
+ goto error_testpoint;
+ }
+
health_code_update();
/* table of connections indexed on socket */
}
DBG("Worker thread cleanup complete");
free(data_buffer);
+error_testpoint:
if (err) {
health_error();
ERR("Health error occurred in %s", __func__);
--- /dev/null
+#ifndef RELAYD_TESTPOINT_H
+#define RELAYD_TESTPOINT_H
+
+/*
+ * Copyright (C) 2012 - Christian Babeux <christian.babeux@efficios.com>
+ * Copyright (C) 2014 - Mathieu Desnoyers <mathieu.desnoyers@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/testpoint/testpoint.h>
+
+/* Testpoints, internal use only */
+TESTPOINT_DECL(relayd_thread_dispatcher);
+TESTPOINT_DECL(relayd_thread_worker);
+TESTPOINT_DECL(relayd_thread_listener);
+TESTPOINT_DECL(relayd_thread_live_dispatcher);
+TESTPOINT_DECL(relayd_thread_live_worker);
+TESTPOINT_DECL(relayd_thread_live_listener);
+
+#endif /* SESSIOND_TESTPOINT_H */