Consumer: add testpoints
[lttng-tools.git] / src / common / consumer.c
index cbcb2f74d27f8dfb8297b8c37f04b67112f6806e..36ec02479edc3b74ccf70df1cc8f6a8a023770fe 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "consumer.h"
 #include "consumer-stream.h"
+#include "consumer-testpoint.h"
 
 struct lttng_consumer_global_data consumer_data = {
        .stream_count = 0,
@@ -2254,6 +2255,10 @@ void *consumer_thread_metadata_poll(void *data)
 
        health_register(health_consumerd, HEALTH_CONSUMERD_TYPE_METADATA);
 
+       if (testpoint(consumerd_thread_metadata)) {
+               goto error_testpoint;
+       }
+
        health_code_update();
 
        DBG("Thread metadata poll started");
@@ -2428,6 +2433,7 @@ end:
 
        lttng_poll_clean(&events);
 end_poll:
+error_testpoint:
        if (err) {
                health_error();
                ERR("Health error occurred in %s", __func__);
@@ -2456,6 +2462,10 @@ void *consumer_thread_data_poll(void *data)
 
        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 *));
@@ -2687,6 +2697,7 @@ end:
         */
        (void) lttng_pipe_write_close(ctx->consumer_metadata_pipe);
 
+error_testpoint:
        if (err) {
                health_error();
                ERR("Health error occurred in %s", __func__);
@@ -2787,6 +2798,10 @@ void *consumer_thread_channel_poll(void *data)
 
        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);
@@ -2988,6 +3003,7 @@ end:
 end_poll:
        destroy_channel_ht(channel_ht);
 end_ht:
+error_testpoint:
        DBG("Channel poll thread exiting");
        if (err) {
                health_error();
@@ -3043,6 +3059,10 @@ void *consumer_thread_sessiond_poll(void *data)
 
        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);
@@ -3179,6 +3199,7 @@ end:
                }
        }
 
+error_testpoint:
        if (err) {
                health_error();
                ERR("Health error occurred in %s", __func__);
This page took 0.02603 seconds and 5 git commands to generate.