Fix: keep ust/kernel session items around for destroy notifier
[lttng-tools.git] / src / bin / lttng-sessiond / trace-ust.c
index 8d63e2525192ad3ef2f473c99f9245b955f86eb0..569599af28c5e7fb6658855f99276d9ef92ea736 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <common/common.h>
 #include <common/defaults.h>
+#include <common/trace-chunk.h>
 
 #include "buffer-registry.h"
 #include "trace-ust.h"
@@ -1160,7 +1161,8 @@ static void destroy_domain_global(struct ltt_ust_domain_global *dom)
 }
 
 /*
- * Cleanup ust session structure
+ * Cleanup ust session structure, keeping data required by
+ * destroy notifier.
  *
  * Should *NOT* be called with RCU read-side lock held.
  */
@@ -1196,9 +1198,13 @@ void trace_ust_destroy_session(struct ltt_ust_session *session)
                buffer_reg_uid_destroy(reg, session->consumer);
        }
 
-       consumer_output_put(session->consumer);
-
        fini_pid_tracker(&session->pid_tracker);
+       lttng_trace_chunk_put(session->current_trace_chunk);
+}
 
+/* Free elements needed by destroy notifiers. */
+void trace_ust_free_session(struct ltt_ust_session *session)
+{
+       consumer_output_put(session->consumer);
        free(session);
 }
This page took 0.023293 seconds and 4 git commands to generate.