X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libust%2Ftracectl.c;h=97ab2eb1fb768433c4561733dcfded9b25cee235;hb=4d65ee62f53c9e3b7c7b56d2067ab347f3ce90aa;hp=5ccd1f5eba14b0846223f297ea78408c9af37fa0;hpb=69ba01560f9193dbf4ad2fc8361efb725704807c;p=lttng-ust.git diff --git a/libust/tracectl.c b/libust/tracectl.c index 5ccd1f5e..97ab2eb1 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -26,6 +26,8 @@ #include #include +#include + #include "marker.h" #include "tracer.h" #include "localerr.h" @@ -106,8 +108,13 @@ void do_command(struct tracecmd *cmd) { } -void receive_commands() +/* This needs to be called whenever a new thread is created. It notifies + * liburcu of the new thread. + */ + +void ust_register_thread(void) { + rcu_register_thread(); } int fd_notif = -1; @@ -224,6 +231,8 @@ void *listener_main(void *p) { int result; + ust_register_thread(); + DBG("LISTENER"); for(;;) { @@ -803,6 +812,12 @@ static void auto_probe_connect(struct marker *m) static void __attribute__((constructor(101))) init0() { + /* Initialize RCU in case the constructor order is not good. */ + urcu_init(); + + /* It is important to do this before events start to be generated. */ + ust_register_thread(); + DBG("UST_AUTOPROBE constructor"); if(getenv("UST_AUTOPROBE")) { marker_set_new_marker_cb(auto_probe_connect);