From: compudj Date: Thu, 9 Mar 2006 22:18:50 +0000 (+0000) Subject: new ltt-usertrace X-Git-Tag: v0.12.20~1838 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fcbe1ea8ecb990b6b2c12afc929c079b3639a4c9;p=lttv.git new ltt-usertrace git-svn-id: http://ltt.polymtl.ca/svn@1651 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt-usertrace/Makefile b/ltt-usertrace/Makefile index aebde690..f15bc5ca 100644 --- a/ltt-usertrace/Makefile +++ b/ltt-usertrace/Makefile @@ -4,7 +4,7 @@ INCLUDE_DIR=/usr/include LIB_DIR=/usr/lib RANLIB=ranlib -CFLAGS=-I. -O3 -L. +CFLAGS=-I. -O2 -L. #For testing lib ltt-usertrace-fast #CFLAGS+=-DLTT_SUBBUF_SIZE_CPU=134217728 diff --git a/ltt-usertrace/ltt-usertrace-fast.c b/ltt-usertrace/ltt-usertrace-fast.c index 28a0ed0e..a0544b67 100644 --- a/ltt-usertrace/ltt-usertrace-fast.c +++ b/ltt-usertrace/ltt-usertrace-fast.c @@ -74,7 +74,7 @@ _syscall0(pid_t,gettid) #include #ifdef LTT_SHOW_DEBUG -#define dbg_printf(...) dbg_printf(__VA_ARGS__) +#define dbg_printf(...) printf(__VA_ARGS__) #else #define dbg_printf(...) #endif //LTT_SHOW_DEBUG @@ -376,14 +376,12 @@ get_error: static void ltt_usertrace_fast_daemon(struct ltt_trace_info *shared_trace_info, sigset_t oldset, pid_t l_traced_pid, pthread_t l_traced_tid) { - sigset_t set; struct sigaction act; int ret; int fd_process; char outfile_name[PATH_MAX]; char identifier_name[PATH_MAX]; - traced_pid = l_traced_pid; traced_tid = l_traced_tid; @@ -431,7 +429,7 @@ static void ltt_usertrace_fast_daemon(struct ltt_trace_info *shared_trace_info, if(ret != -1) { perror("LTT Error in sigsuspend\n"); } - if(traced_pid == 0 || parent_exited) goto dead_parent; + if((traced_pid == 0) || parent_exited) goto dead_parent; #ifndef LTT_NULL_OUTPUT_TEST fd_process = creat(outfile_name, 0644); @@ -455,6 +453,7 @@ static void ltt_usertrace_fast_daemon(struct ltt_trace_info *shared_trace_info, do { ret = read_subbuffer(&shared_trace_info->channel.process, fd_process); } while(ret == 0); + ret = sigsuspend(&oldset); if(ret != -1) { perror("LTT Error in sigsuspend\n"); @@ -528,7 +527,6 @@ void ltt_rw_init(void) dbg_printf("LTT Error in sigfillset\n"); } - ret = pthread_sigmask(SIG_BLOCK, &set, &oldset); if(ret) { dbg_printf("LTT Error in pthread_sigmask\n"); diff --git a/ltt-usertrace/sample-thread-fast.c b/ltt-usertrace/sample-thread-fast.c index 46ffbd12..6376f376 100644 --- a/ltt-usertrace/sample-thread-fast.c +++ b/ltt-usertrace/sample-thread-fast.c @@ -31,7 +31,7 @@ void *thr2(void *arg) printf("thread 2, thread id : %lu, pid %lu\n", pthread_self(), getpid()); for(i=0; i<100000; i++) { - trace_user_generic_string("Hello world! Have a nice day."); +// trace_user_generic_string("Hello world! Have a nice day."); } /* This thread is a bad citizen : returning like this will cause its cancel * routines not to be executed. This is still detected by the tracer, but only