add ust_fork()
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Wed, 22 Jul 2009 21:48:12 +0000 (17:48 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Wed, 22 Jul 2009 21:48:12 +0000 (17:48 -0400)
libust/tracectl.c

index 97ab2eb1fb768433c4561733dcfded9b25cee235..9dfc8af6f6ad6ccb3b611cbb1136c552238046f0 100644 (file)
@@ -920,3 +920,24 @@ static void __attribute__((destructor)) fini()
        destroy_socket();
 }
 #endif
+
+/* Notify ust that there was a fork. This needs to be called inside
+ * the new process, anytime a process whose memory is not shared with
+ * the parent is created. If this function is not called, the events
+ * of the new process will not be collected.
+ */
+
+void ust_fork(void)
+{
+       DBG("ust: forking");
+       ltt_trace_stop("auto");
+       ltt_trace_destroy("auto");
+       ltt_trace_alloc("auto");
+       ltt_trace_start("auto");
+       init_socket();
+       have_listener = 0;
+       create_listener();
+       ustcomm_request_consumer(getpid(), "metadata");
+       ustcomm_request_consumer(getpid(), "ust");
+}
+
This page took 0.026183 seconds and 4 git commands to generate.