relayd: add testpoints
[lttng-tools.git] / src / bin / lttng-relayd / live.c
index bfa7b85259ad7d3d2a75fdba5dfb416feccfe13c..80c3da57ac63d2ee0fd69b5942e063c7aefa4f16 100644 (file)
@@ -57,6 +57,7 @@
 #include "lttng-viewer.h"
 #include "utils.h"
 #include "health-relayd.h"
+#include "testpoint.h"
 
 static struct lttng_uri *live_uri;
 
@@ -253,6 +254,10 @@ void *thread_listener(void *data)
 
        lttng_relay_notify_ready();
 
+       if (testpoint(relayd_thread_live_listener)) {
+               goto error_testpoint;
+       }
+
        while (1) {
                health_code_update();
 
@@ -340,6 +345,7 @@ restart:
 exit:
 error:
 error_poll_add:
+error_testpoint:
        lttng_poll_clean(&events);
 error_create_poll:
        if (live_control_sock->fd >= 0) {
@@ -375,6 +381,10 @@ void *thread_dispatcher(void *data)
 
        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)) {
@@ -423,6 +433,7 @@ void *thread_dispatcher(void *data)
        err = 0;
 
 error:
+error_testpoint:
        if (err) {
                health_error();
                ERR("Health error occurred in %s", __func__);
@@ -1825,6 +1836,10 @@ void *thread_worker(void *data)
 
        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) {
@@ -1980,6 +1995,7 @@ relay_connections_ht_error:
                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__);
This page took 0.025736 seconds and 5 git commands to generate.