relayd: add testpoints
[lttng-tools.git] / src / bin / lttng-relayd / main.c
index 4d53ba9c886f80dfa96dd5261d612e603e7ce601..1eb28f6fc1d240074f01f0643f844e81c8961864 100644 (file)
@@ -59,6 +59,7 @@
 #include "lttng-relayd.h"
 #include "live.h"
 #include "health-relayd.h"
+#include "testpoint.h"
 
 /* command line options */
 char *opt_output_path;
@@ -613,6 +614,10 @@ void *relay_thread_listener(void *data)
 
        lttng_relay_notify_ready();
 
+       if (testpoint(relayd_thread_listener)) {
+               goto error_testpoint;
+       }
+
        while (1) {
                health_code_update();
 
@@ -713,6 +718,7 @@ restart:
 exit:
 error:
 error_poll_add:
+error_testpoint:
        lttng_poll_clean(&events);
 error_create_poll:
        if (data_sock->fd >= 0) {
@@ -756,6 +762,10 @@ void *relay_thread_dispatcher(void *data)
 
        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)) {
@@ -802,6 +812,7 @@ void *relay_thread_dispatcher(void *data)
        err = 0;
 
 error:
+error_testpoint:
        if (err) {
                health_error();
                ERR("Health error occurred in %s", __func__);
@@ -2420,6 +2431,10 @@ void *relay_thread_worker(void *data)
 
        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 */
@@ -2681,6 +2696,7 @@ relay_connections_ht_error:
        }
        DBG("Worker thread cleanup complete");
        free(data_buffer);
+error_testpoint:
        if (err) {
                health_error();
                ERR("Health error occurred in %s", __func__);
This page took 0.025128 seconds and 4 git commands to generate.