consumerd: register threads to health monitoring
[lttng-tools.git] / src / bin / lttng-consumerd / lttng-consumerd.c
index 59397594b914c2c99533ff408d77d9c824c08034..e33a470f59268e6c3f33f09c72e506930ae859fd 100644 (file)
@@ -49,6 +49,7 @@
 #include <common/sessiond-comm/sessiond-comm.h>
 
 #include "lttng-consumerd.h"
+#include "health-consumerd.h"
 
 /* TODO : support UST (all direct kernel-ctl accesses). */
 
@@ -72,6 +73,9 @@ static enum lttng_consumer_type opt_type = LTTNG_CONSUMER_KERNEL;
 /* the liblttngconsumerd context */
 static struct lttng_consumer_local_data *ctx;
 
+/* Consumerd health monitoring */
+struct health_app *health_consumerd;
+
 /*
  * Signal handler for the daemon
  */
@@ -325,6 +329,11 @@ int main(int argc, char **argv)
                set_ulimit();
        }
 
+       health_consumerd = health_app_create(NR_HEALTH_CONSUMERD_TYPES);
+       if (!health_consumerd) {
+               goto error;
+       }
+
        /* create the consumer instance with and assign the callbacks */
        ctx = lttng_consumer_create(opt_type, lttng_consumer_read_subbuffer,
                NULL, lttng_consumer_on_recv_stream, NULL);
@@ -469,6 +478,9 @@ error:
 end:
        lttng_consumer_destroy(ctx);
        lttng_consumer_cleanup();
+       if (health_consumerd) {
+               health_app_destroy(health_consumerd);
+       }
 
        return ret;
 }
This page took 0.024282 seconds and 5 git commands to generate.