$(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/common/index/libindex.la \
$(top_builddir)/src/common/health/libhealth.la \
+ $(top_builddir)/src/common/testpoint/libtestpoint.la \
-lrt
if HAVE_LIBLTTNG_UST_CTL
noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \
uri.h utils.h lttng-kernel-old.h \
- consumer-metadata-cache.h consumer-timer.h
+ consumer-metadata-cache.h consumer-timer.h \
+ consumer-testpoint.h
# Common library
noinst_LTLIBRARIES = libcommon.la
--- /dev/null
+#ifndef CONSUMERD_TESTPOINT_H
+#define CONSUMERD_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(consumerd_thread_channel);
+TESTPOINT_DECL(consumerd_thread_metadata);
+TESTPOINT_DECL(consumerd_thread_data);
+TESTPOINT_DECL(consumerd_thread_sessiond);
+TESTPOINT_DECL(consumerd_thread_metadata_timer);
+
+#endif /* CONSUMERD_TESTPOINT_H */
#include <common/consumer-stream.h>
#include "consumer-timer.h"
+#include "consumer-testpoint.h"
#include "ust-consumer/ust-consumer.h"
static struct timer_signal_data timer_signal = {
health_register(health_consumerd, HEALTH_CONSUMERD_TYPE_METADATA_TIMER);
+ if (testpoint(consumerd_thread_metadata_timer)) {
+ goto error_testpoint;
+ }
+
health_code_update();
/* Only self thread will receive signal mask. */
}
}
- /* Currently never reached */
+error_testpoint:
+ /* Only reached in testpoint error */
+ health_error();
health_unregister(health_consumerd);
/* Never return */
#include "consumer.h"
#include "consumer-stream.h"
+#include "consumer-testpoint.h"
struct lttng_consumer_global_data consumer_data = {
.stream_count = 0,
health_register(health_consumerd, HEALTH_CONSUMERD_TYPE_METADATA);
+ if (testpoint(consumerd_thread_metadata)) {
+ goto error_testpoint;
+ }
+
health_code_update();
DBG("Thread metadata poll started");
lttng_poll_clean(&events);
end_poll:
+error_testpoint:
if (err) {
health_error();
ERR("Health error occurred in %s", __func__);
health_register(health_consumerd, HEALTH_CONSUMERD_TYPE_DATA);
+ if (testpoint(consumerd_thread_data)) {
+ goto error_testpoint;
+ }
+
health_code_update();
local_stream = zmalloc(sizeof(struct lttng_consumer_stream *));
*/
(void) lttng_pipe_write_close(ctx->consumer_metadata_pipe);
+error_testpoint:
if (err) {
health_error();
ERR("Health error occurred in %s", __func__);
health_register(health_consumerd, HEALTH_CONSUMERD_TYPE_CHANNEL);
+ if (testpoint(consumerd_thread_channel)) {
+ goto error_testpoint;
+ }
+
health_code_update();
channel_ht = lttng_ht_new(0, LTTNG_HT_TYPE_U64);
end_poll:
destroy_channel_ht(channel_ht);
end_ht:
+error_testpoint:
DBG("Channel poll thread exiting");
if (err) {
health_error();
health_register(health_consumerd, HEALTH_CONSUMERD_TYPE_SESSIOND);
+ if (testpoint(consumerd_thread_sessiond)) {
+ goto error_testpoint;
+ }
+
health_code_update();
DBG("Creating command socket %s", ctx->consumer_command_sock_path);
}
}
+error_testpoint:
if (err) {
health_error();
ERR("Health error occurred in %s", __func__);