sessiond: kernel triggers: add infrastructure to create event notifiers
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 4bdac5217978d28dd2af6c036d66f0650615a9bf..e646a6de5742df1998c38bf794aa68012293f011 100644 (file)
@@ -1726,6 +1726,18 @@ int main(int argc, char **argv)
                        retval = -1;
                        goto stop_threads;
                }
+
+               if (kernel_get_notification_fd() >= 0) {
+                       ret = notification_thread_command_add_tracer_event_source(
+                                       notification_thread_handle,
+                                       kernel_get_notification_fd(),
+                                       LTTNG_DOMAIN_KERNEL);
+                       if (ret != LTTNG_OK) {
+                               ERR("Failed to add kernel trigger event source to notification thread");
+                               retval = -1;
+                               goto stop_threads;
+                       }
+               }
        }
 
        /* Load sessions. */
@@ -1779,6 +1791,13 @@ stop_threads:
        rcu_thread_online();
        sessiond_cleanup();
 
+       /*
+        * Wait for all pending call_rcu work to complete tearing shutting down
+        * the notification thread. This call_rcu work includes shutting down
+        * UST apps and event notifier pipes.
+        */
+       rcu_barrier();
+
        if (notification_thread) {
                lttng_thread_shutdown(notification_thread);
                lttng_thread_put(notification_thread);
This page took 0.023802 seconds and 4 git commands to generate.