#include <poll.h>
#include <regex.h>
-#include <urcu.h>
+#include <urcu-bp.h>
#include "marker.h"
#include "tracer.h"
/* 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;
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();
}
}
-int have_listener = 0;
+volatile sig_atomic_t have_listener = 0;
void create_listener(void)
{
void sighandler(int sig)
{
- static char have_listener = 0;
DBG("sighandler");
if(!have_listener) {
create_listener();
- have_listener = 1;
}
}
}
-static void __attribute__((constructor(1000))) init()
+static void __attribute__((constructor)) init()
{
int result;
char* autoprobe_val = NULL;
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);
}
{
trace_mark(ust, potential_exec, MARK_NOARGS);
+ DBG("test");
+
keepalive();
}