+static int handle_trigger_event_pipe(int fd,
+ enum lttng_domain_type domain,
+ uint32_t revents,
+ struct notification_thread_state *state)
+{
+ int ret = 0;
+
+ if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) {
+ ret = lttng_poll_del(&state->events, fd);
+ if (ret) {
+ ERR("[notification-thread] Failed to remove event monitoring pipe from poll set");
+ }
+ goto end;
+ }
+
+ if (testpoint(sessiond_handle_trigger_event_pipe)) {
+ ret = 0;
+ goto end;
+ }
+
+ if (caa_unlikely(trigger_consumption_paused)) {
+ DBG("Trigger consumption paused, sleeping...");
+ sleep(1);
+ goto end;
+ }
+
+ ret = handle_notification_thread_event(state, fd, domain);
+ if (ret) {
+ ERR("[notification-thread] Event sample handling error occurred for fd: %d", fd);
+ ret = -1;
+ goto end;
+ }
+
+end:
+ return ret;
+}
+
+/*
+ * Return the event source domain type via parameter.
+ */
+static bool fd_is_event_source(struct notification_thread_handle *handle, int fd, enum lttng_domain_type *domain)
+{
+ struct notification_event_trigger_source_element *source_element, *tmp;
+
+ assert(domain);
+
+ cds_list_for_each_entry_safe(source_element, tmp,
+ &handle->event_trigger_sources.list, node) {
+ if (source_element->fd != fd) {
+ continue;
+ }
+ *domain = source_element->domain;
+ return true;
+ }
+ return false;
+}
+