From 4c992ad50b09ff90b6e88f1d4a5718fd86f58a7f Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 8 Mar 2006 17:36:54 +0000 Subject: [PATCH] traced_tid with gettid git-svn-id: http://ltt.polymtl.ca/svn@1617 04897980-b3bd-0310-b5e0-8ef037075253 --- usertrace-fast/ltt-usertrace-fast.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usertrace-fast/ltt-usertrace-fast.c b/usertrace-fast/ltt-usertrace-fast.c index fc919c34..aaa571c5 100644 --- a/usertrace-fast/ltt-usertrace-fast.c +++ b/usertrace-fast/ltt-usertrace-fast.c @@ -93,7 +93,7 @@ static void ltt_usertrace_fast_cleanup(void *arg) /* Reader (the disk dumper daemon) */ static pid_t traced_pid = 0; -static pthread_t traced_thread = 0; +static pid_t traced_tid = 0; static int parent_exited = 0; /* signal handling */ @@ -365,7 +365,7 @@ get_error: /* This function is called by ltt_rw_init which has signals blocked */ 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_thread) + sigset_t oldset, pid_t l_traced_pid, pthread_t l_traced_tid) { struct sigaction act; int ret; @@ -376,10 +376,10 @@ static void ltt_usertrace_fast_daemon(struct ltt_trace_info *shared_trace_info, traced_pid = l_traced_pid; - traced_thread = l_traced_thread; + traced_tid = l_traced_tid; - printf("LTT ltt_usertrace_fast_daemon : init is %d, pid is %lu, traced_pid is %lu\n", - shared_trace_info->init, getpid(), traced_pid); + printf("LTT ltt_usertrace_fast_daemon : init is %d, pid is %lu, traced_pid is %lu, traced_tid is %lu\n", + shared_trace_info->init, getpid(), traced_pid, traced_tid); act.sa_handler = handler_sigusr1; act.sa_flags = 0; @@ -420,7 +420,7 @@ static void ltt_usertrace_fast_daemon(struct ltt_trace_info *shared_trace_info, exit(-1); } snprintf(identifier_name, PATH_MAX-1, "%lu.%lu.%llu", - traced_pid, traced_thread, get_cycles()); + traced_pid, traced_tid, get_cycles()); snprintf(outfile_name, PATH_MAX-1, "facilities-%s", identifier_name); fd_fac = creat(outfile_name, 0644); @@ -480,7 +480,7 @@ void ltt_rw_init(void) int ret; sigset_t set, oldset; pid_t l_traced_pid = getpid(); - pthread_t l_traced_thread = pthread_self(); + pid_t l_traced_tid = gettid(); /* parent : create the shared memory map */ shared_trace_info = mmap(0, sizeof(*thread_trace_info), @@ -532,7 +532,7 @@ void ltt_rw_init(void) /* Child */ role = LTT_ROLE_READER; ltt_usertrace_fast_daemon(shared_trace_info, oldset, l_traced_pid, - l_traced_thread); + l_traced_tid); /* Should never return */ exit(-1); } else if(pid < 0) { -- 2.34.1