X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread.c;h=56f1124fbfbfbde93c7a1ba9959182221e58095d;hb=670a26e4165562ab2dc5a16b9941f942e4f30996;hp=dd1dc3e8fe50753cfe7ac10978a6f6898df25dd3;hpb=8b5240601e4ddf6127e4291b7194dd5179cb35b5;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/notification-thread.c b/src/bin/lttng-sessiond/notification-thread.c index dd1dc3e8f..56f1124fb 100644 --- a/src/bin/lttng-sessiond/notification-thread.c +++ b/src/bin/lttng-sessiond/notification-thread.c @@ -27,6 +27,7 @@ #include "lttng-sessiond.h" #include "health-sessiond.h" #include "thread.h" +#include "testpoint.h" #include "kernel.h" #include @@ -35,6 +36,8 @@ #include #include + +int notifier_consumption_paused; /* * Destroy the thread data previously created by the init function. */ @@ -235,8 +238,8 @@ int notification_channel_socket_create(void) if (getuid() == 0) { gid_t gid; - ret = utils_get_group_id(config.tracing_group_name.value, true, - &gid); + ret = utils_get_group_id(the_config.tracing_group_name.value, + true, &gid); if (ret) { /* Default to root group. */ gid = 0; @@ -574,6 +577,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 +596,7 @@ static int handle_event_notification_pipe(int event_source_fd, ret = -1; goto end; } + end: return ret; } @@ -624,7 +639,7 @@ void *thread_notification(void *data) DBG("[notification-thread] Started notification thread"); - health_register(health_sessiond, HEALTH_SESSIOND_TYPE_NOTIFICATION); + health_register(the_health_sessiond, HEALTH_SESSIOND_TYPE_NOTIFICATION); rcu_register_thread(); rcu_thread_online(); @@ -640,6 +655,10 @@ void *thread_notification(void *data) goto end; } + if (testpoint(sessiond_thread_notification)) { + goto end; + } + while (true) { int fd_count, i; @@ -759,7 +778,7 @@ error: end: rcu_thread_offline(); rcu_unregister_thread(); - health_unregister(health_sessiond); + health_unregister(the_health_sessiond); return NULL; }