Move code out of main.c and fix some issues
[lttng-tools.git] / src / bin / lttng-sessiond / kernel.c
index f734760778db81f24d704f59d416ca7ce68af845..d52d9aa62f4e997b327fe2d1ec336ed5414392f8 100644 (file)
@@ -28,6 +28,7 @@
 #include <common/kernel-ctl/kernel-ctl.h>
 #include <common/sessiond-comm/sessiond-comm.h>
 
+#include "consumer.h"
 #include "kernel.h"
 #include "kern-modules.h"
 
@@ -718,3 +719,21 @@ int init_kernel_workarounds(void)
 end_boot_id:
        return 0;
 }
+
+/*
+ * Complete teardown of a kernel session.
+ */
+void kernel_destroy_session(struct ltt_kernel_session *ksess)
+{
+       if (ksess == NULL) {
+               DBG3("No kernel session when tearing down session");
+               return;
+       }
+
+       DBG("Tearing down kernel session");
+
+       /* Close any relayd session */
+       consumer_output_send_destroy_relayd(ksess->consumer);
+
+       trace_kernel_destroy_session(ksess);
+}
This page took 0.024887 seconds and 5 git commands to generate.