X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libust%2Ftracectl.c;h=9a651d85d38cc915ee9b2327c0c1cd092f9439d3;hb=775c8a3f299e02caae0bc6faf316c44cc020efe1;hp=83109a14c222d9f8719dc3710726f1a35a9544b6;hpb=d9ce395d9a7d0d6628d6f495e4bacb912abfcba9;p=ust.git diff --git a/libust/tracectl.c b/libust/tracectl.c index 83109a1..9a651d8 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include "marker.h" #include "tracer.h" @@ -121,7 +121,7 @@ static void print_markers(FILE *fp) marker_iter_start(&iter); while(iter.marker) { - fprintf(fp, "marker: %s_%s %d \"%s\"\n", iter.marker->channel, iter.marker->name, (int)imv_read(iter.marker->state), iter.marker->format); + fprintf(fp, "marker: %s/%s %d \"%s\"\n", iter.marker->channel, iter.marker->name, (int)imv_read(iter.marker->state), iter.marker->format); marker_iter_next(&iter); } unlock_markers(); @@ -772,7 +772,7 @@ void *listener_main(void *p) } } -int have_listener = 0; +volatile sig_atomic_t have_listener = 0; void create_listener(void) { @@ -804,12 +804,10 @@ void create_listener(void) void sighandler(int sig) { - static char have_listener = 0; DBG("sighandler"); if(!have_listener) { create_listener(); - have_listener = 1; } } @@ -894,7 +892,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; @@ -1008,13 +1006,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); } @@ -1132,6 +1132,8 @@ void ust_potential_exec(void) { trace_mark(ust, potential_exec, MARK_NOARGS); + DBG("test"); + keepalive(); }