From 1e2944cb1e15d658b5991026e5604c56f551e2ab Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Wed, 22 Jul 2009 17:48:12 -0400 Subject: [PATCH] add ust_fork() --- libust/tracectl.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libust/tracectl.c b/libust/tracectl.c index 97ab2eb..9dfc8af 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -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"); +} + -- 2.34.1