--- glibc-20081113T2206/nptl/pthread_create.c 2008-04-09 19:58:06.000000000 +0200 +++ /home/tralamazza/glibc-20081113T2206/nptl/pthread_create.c 2009-02-17 16:09:05.000000000 +0100 @@ -292,12 +292,14 @@ CANCEL_RESET (oldtype); } + PTHREAD_PROBE_START(pd->arg); /* Run the code the user provided. */ #ifdef CALL_THREAD_FCT THREAD_SETMEM (pd, result, CALL_THREAD_FCT (pd)); #else THREAD_SETMEM (pd, result, pd->start_routine (pd->arg)); #endif + PTHREAD_PROBE_END(pd->result); } /* Run the destructor for the thread-local data. */ @@ -533,6 +535,7 @@ threads. */ bool is_detached = IS_DETACHED (pd); + PTHREAD_PROBE_CREATE(newthread, start_routine, arg); /* Start the thread. */ err = create_thread (pd, iattr, STACK_VARIABLES_ARGS); if (err != 0) --- glibc-20081113T2206/nptl/pthread_join.c 2007-01-18 23:19:38.000000000 +0100 +++ /home/tralamazza/glibc-20081113T2206/nptl/pthread_join.c 2009-02-17 16:09:05.000000000 +0100 @@ -52,6 +52,7 @@ /* We cannot wait for the thread. */ return EINVAL; + PTHREAD_PROBE_JOIN(threadid); struct pthread *self = THREAD_SELF; int result = 0; @@ -110,5 +111,6 @@ __free_tcb (pd); } + PTHREAD_PROBE_JOIN_RET(threadid, result); return result; } --- glibc-20081113T2206/nptl/pthread_mutex_destroy.c 2006-07-29 06:21:27.000000000 +0200 +++ /home/tralamazza/glibc-20081113T2206/nptl/pthread_mutex_destroy.c 2009-02-17 16:09:05.000000000 +0100 @@ -32,6 +32,7 @@ /* Set to an invalid value. */ mutex->__data.__kind = -1; + PTHREAD_PROBE_MUTEX_DESTROY(mutex); return 0; } strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy) --- glibc-20081113T2206/nptl/pthread_mutex_init.c 2007-08-13 20:32:59.000000000 +0200 +++ /home/tralamazza/glibc-20081113T2206/nptl/pthread_mutex_init.c 2009-02-17 16:09:05.000000000 +0100 @@ -135,6 +135,7 @@ // mutex->__spins = 0; already done by memset // mutex->__next = NULL; already done by memset + PTHREAD_PROBE_MUTEX_INIT(mutex); return 0; } strong_alias (__pthread_mutex_init, pthread_mutex_init) --- glibc-20081113T2206/nptl/pthread_mutex_lock.c 2008-11-01 20:49:08.000000000 +0100 +++ /home/tralamazza/glibc-20081113T2206/nptl/pthread_mutex_lock.c 2009-02-17 16:09:05.000000000 +0100 @@ -62,9 +62,11 @@ ++mutex->__data.__count; + PTHREAD_PROBE_MUTEX_ACQUIRE(mutex); return 0; } + PTHREAD_PROBE_MUTEX_BLOCK(mutex); /* We have to get the mutex. */ LLL_MUTEX_LOCK (mutex); @@ -82,6 +84,7 @@ case PTHREAD_MUTEX_TIMED_NP: simple: + PTHREAD_PROBE_MUTEX_BLOCK(mutex); /* Normal mutex. */ LLL_MUTEX_LOCK (mutex); assert (mutex->__data.__owner == 0); @@ -100,6 +103,7 @@ { if (cnt++ >= max_cnt) { + PTHREAD_PROBE_MUTEX_BLOCK(mutex); LLL_MUTEX_LOCK (mutex); break; } @@ -190,6 +194,7 @@ ++mutex->__data.__count; + PTHREAD_PROBE_MUTEX_ACQUIRE(mutex); return 0; } } @@ -254,6 +259,7 @@ ++mutex->__data.__count; + PTHREAD_PROBE_MUTEX_ACQUIRE(mutex); return 0; } } @@ -373,6 +379,7 @@ ++mutex->__data.__count; + PTHREAD_PROBE_MUTEX_ACQUIRE(mutex); return 0; } } @@ -444,7 +451,8 @@ #ifndef NO_INCR ++mutex->__data.__nusers; #endif - + if (retval == 0) + PTHREAD_PROBE_MUTEX_ACQUIRE(mutex); return retval; } #ifndef __pthread_mutex_lock --- glibc-20081113T2206/nptl/pthread_mutex_unlock.c 2008-11-01 20:42:36.000000000 +0100 +++ /home/tralamazza/glibc-20081113T2206/nptl/pthread_mutex_unlock.c 2009-02-17 16:09:05.000000000 +0100 @@ -257,6 +257,7 @@ return EINVAL; } + PTHREAD_PROBE_MUTEX_RELEASE(mutex); return 0; } --- glibc-20081113T2206/nptl/pthreadP.h 2007-08-11 20:45:00.000000000 +0200 +++ /home/tralamazza/glibc-20081113T2206/nptl/pthreadP.h 2009-02-17 16:09:05.000000000 +0100 @@ -33,6 +33,7 @@ #include #include +#include "pthread_probe.h" /* Atomic operations on TLS memory. */ #ifndef THREAD_ATOMIC_CMPXCHG_VAL