tracectl.c: minor cleanup
[ust.git] / libust / tracectl.c
index 17d28dca61394f744077fea45f5fea1bf5d17e43..dbd39657e6f507585b8f2e9c4a29115dd96917e4 100644 (file)
@@ -27,7 +27,7 @@
 #include <poll.h>
 #include <regex.h>
 
-#include <urcu.h>
+#include <urcu-bp.h>
 
 #include "marker.h"
 #include "tracer.h"
@@ -63,10 +63,6 @@ struct tracecmd { /* no padding */
 /* volatile because shared between the listener and the main thread */
 volatile sig_atomic_t buffers_to_export = 0;
 
-//struct listener_arg {
-//     int pipe_fd;
-//};
-
 struct trctl_msg {
        /* size: the size of all the fields except size itself */
        uint32_t size;
@@ -772,7 +768,7 @@ void *listener_main(void *p)
        }
 }
 
-int have_listener = 0;
+volatile sig_atomic_t have_listener = 0;
 
 void create_listener(void)
 {
@@ -892,7 +888,7 @@ static void auto_probe_connect(struct marker *m)
 
 }
 
-static void __attribute__((constructor(1000))) init()
+static void __attribute__((constructor)) init()
 {
        int result;
        char* autoprobe_val = NULL;
@@ -1006,13 +1002,15 @@ static void __attribute__((constructor(1000))) init()
                        return;
                }
 
-               inform_consumer_daemon(trace_name);
-
                result = ltt_trace_start(trace_name);
                if(result < 0) {
                        ERR("ltt_trace_start failed");
                        return;
                }
+
+               /* Do this after the trace is started in order to avoid creating confusion
+                * if the trace fails to start. */
+               inform_consumer_daemon(trace_name);
        }
 
 
@@ -1130,6 +1128,8 @@ void ust_potential_exec(void)
 {
        trace_mark(ust, potential_exec, MARK_NOARGS);
 
+       DBG("test");
+
        keepalive();
 }
 
This page took 0.02393 seconds and 4 git commands to generate.