SoW-2020-0002: Trace Hit Counters
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread.c
index dd1dc3e8fe50753cfe7ac10978a6f6898df25dd3..b91dc5798df67140a43958f5cf87e128bd60acc7 100644 (file)
@@ -27,6 +27,7 @@
 #include "lttng-sessiond.h"
 #include "health-sessiond.h"
 #include "thread.h"
+#include "testpoint.h"
 
 #include "kernel.h"
 #include <common/kernel-ctl/kernel-ctl.h>
@@ -35,6 +36,8 @@
 #include <urcu/list.h>
 #include <urcu/rculfhash.h>
 
+
+int notifier_consumption_paused;
 /*
  * Destroy the thread data previously created by the init function.
  */
@@ -482,6 +485,7 @@ int init_thread_state(struct notification_thread_handle *handle,
        if (!state->channels_ht) {
                goto error;
        }
+
        state->sessions_ht = cds_lfht_new(DEFAULT_HT_SIZE,
                        1, 0, CDS_LFHT_AUTO_RESIZE | CDS_LFHT_ACCOUNTING, NULL);
        if (!state->sessions_ht) {
@@ -574,6 +578,17 @@ static int handle_event_notification_pipe(int event_source_fd,
                goto end;
        }
 
+       if (testpoint(sessiond_handle_notifier_event_pipe)) {
+               ret = 0;
+               goto end;
+       }
+
+       if (caa_unlikely(notifier_consumption_paused)) {
+               DBG("Event notifier notification consumption paused, sleeping...");
+               sleep(1);
+               goto end;
+       }
+
        ret = handle_notification_thread_event_notification(
                        state, event_source_fd, domain);
        if (ret) {
@@ -582,6 +597,7 @@ static int handle_event_notification_pipe(int event_source_fd,
                ret = -1;
                goto end;
        }
+
 end:
        return ret;
 }
@@ -640,6 +656,10 @@ void *thread_notification(void *data)
                goto end;
        }
 
+       if (testpoint(sessiond_thread_notification)) {
+               goto end;
+       }
+
        while (true) {
                int fd_count, i;
 
This page took 0.024391 seconds and 5 git commands to generate.