CC=gcc
-test: test.c lttng_usertrace.c
+test: test.c ltt-usertrace-fast.c
$(CC) $(CFLAGS) -lpthread -o $@ $^
.PHONY : clean
#include <malloc.h>
#include <string.h>
-#include "ltt_usertrace.h"
+#include "ltt-usertrace-fast.h"
/* TLS for the trace buffer
* http://www.dis.com/gnu/gcc/C--98-Thread-Local-Edits.html
printf("LTTng usertrace-fast init\n");
-
+ ltt_thread_init();
}
struct lttng_trace_info {
struct _pthread_cleanup_buffer cleanup;
+ int init;
int filter;
atomic_t nesting;
struct {
#include <unistd.h>
#include <stdlib.h>
-#include "lttng_usertrace.h"
+#include "ltt-usertrace-fast.h"
void *thr1(void *arg)
{
+ ltt_thread_init();
printf("thread 1, thread id : %lu, pid %lu\n", pthread_self(), getpid());
while(1) {}
void *thr2(void *arg)
{
+ ltt_thread_init();
while(1) {
printf("thread 2, thread id : %lu, pid %lu\n", pthread_self(), getpid());
sleep(2);