From: Pierre-Marc Fournier Date: Wed, 22 Jul 2009 21:48:12 +0000 (-0400) Subject: add ust_fork() X-Git-Tag: v0.1~171 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=1e2944cb1e15d658b5991026e5604c56f551e2ab;p=ust.git add ust_fork() --- 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"); +} +