From 1c48e587d7940c6f370ce4a9d01dd8b3f3fd7a32 Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 7 Mar 2006 15:43:13 +0000 Subject: [PATCH] add usertrace-fast git-svn-id: http://ltt.polymtl.ca/svn@1606 04897980-b3bd-0310-b5e0-8ef037075253 --- usertrace-fast/Makefile | 2 +- usertrace-fast/ltt-usertrace-fast.c | 4 ++-- usertrace-fast/ltt-usertrace-fast.h | 1 + usertrace-fast/test.c | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/usertrace-fast/Makefile b/usertrace-fast/Makefile index 83c3b89f..6cfaec6a 100644 --- a/usertrace-fast/Makefile +++ b/usertrace-fast/Makefile @@ -2,7 +2,7 @@ CC=gcc -test: test.c lttng_usertrace.c +test: test.c ltt-usertrace-fast.c $(CC) $(CFLAGS) -lpthread -o $@ $^ .PHONY : clean diff --git a/usertrace-fast/ltt-usertrace-fast.c b/usertrace-fast/ltt-usertrace-fast.c index f910e069..42dde3e5 100644 --- a/usertrace-fast/ltt-usertrace-fast.c +++ b/usertrace-fast/ltt-usertrace-fast.c @@ -18,7 +18,7 @@ #include #include -#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 @@ -71,7 +71,7 @@ void __attribute__((constructor)) __ltt_usertrace_fast_init(void) printf("LTTng usertrace-fast init\n"); - + ltt_thread_init(); } diff --git a/usertrace-fast/ltt-usertrace-fast.h b/usertrace-fast/ltt-usertrace-fast.h index a740a832..ac509c24 100644 --- a/usertrace-fast/ltt-usertrace-fast.h +++ b/usertrace-fast/ltt-usertrace-fast.h @@ -29,6 +29,7 @@ struct ltt_buf { struct lttng_trace_info { struct _pthread_cleanup_buffer cleanup; + int init; int filter; atomic_t nesting; struct { diff --git a/usertrace-fast/test.c b/usertrace-fast/test.c index 33937f3b..2bd12e13 100644 --- a/usertrace-fast/test.c +++ b/usertrace-fast/test.c @@ -4,12 +4,13 @@ #include #include -#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) {} @@ -20,6 +21,7 @@ void *thr1(void *arg) void *thr2(void *arg) { + ltt_thread_init(); while(1) { printf("thread 2, thread id : %lu, pid %lu\n", pthread_self(), getpid()); sleep(2); -- 2.34.1