#include "lttng-relayd.h"
#include "live.h"
#include "health-relayd.h"
+#include "testpoint.h"
/* command line options */
char *opt_output_path;
* 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 };
+int thread_quit_pipe[2] = { -1, -1 };
/*
* This pipe is used to inform the worker thread that a command is queued and
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__);
goto exit_listener;
}
- ret = live_start_threads(live_uri, relay_ctx, thread_quit_pipe);
+ ret = live_start_threads(live_uri, relay_ctx);
if (ret != 0) {
ERR("Starting live viewer threads");
goto exit_live;