X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust-libc-wrapper%2Flttng-ust-pthread.c;h=6554a47afe7057f3b8c2c21147574c2f77d5ad09;hb=553bbf7f38652084ed7966c7817b8ccb372b14e1;hp=45789aa3463108c72990ad752912309870514a39;hpb=f02baefb3ba4d5493816d63f65625ba4269224d2;p=lttng-ust.git diff --git a/liblttng-ust-libc-wrapper/lttng-ust-pthread.c b/liblttng-ust-libc-wrapper/lttng-ust-pthread.c index 45789aa3..6554a47a 100644 --- a/liblttng-ust-libc-wrapper/lttng-ust-pthread.c +++ b/liblttng-ust-libc-wrapper/lttng-ust-pthread.c @@ -17,14 +17,22 @@ */ #define _GNU_SOURCE +/* + * Do _not_ define _LGPL_SOURCE because we don't want to create a + * circular dependency loop between this malloc wrapper, liburcu and + * libc. + */ #include +#include +#include #include #define TRACEPOINT_DEFINE #define TRACEPOINT_CREATE_PROBES +#define TP_IP_PARAM ip #include "ust_pthread.h" -static __thread int thread_in_trace; +static DEFINE_URCU_TLS_IE(int, thread_in_trace); int pthread_mutex_lock(pthread_mutex_t *mutex) { @@ -46,9 +54,11 @@ int pthread_mutex_lock(pthread_mutex_t *mutex) } thread_in_trace = 1; - tracepoint(ust_pthread, pthread_mutex_lock_req, mutex); + tracepoint(lttng_ust_pthread, pthread_mutex_lock_req, mutex, + LTTNG_UST_CALLER_IP()); retval = mutex_lock(mutex); - tracepoint(ust_pthread, pthread_mutex_lock_acq, mutex, retval); + tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex, + retval, LTTNG_UST_CALLER_IP()); thread_in_trace = 0; return retval; } @@ -74,7 +84,8 @@ int pthread_mutex_trylock(pthread_mutex_t *mutex) thread_in_trace = 1; retval = mutex_trylock(mutex); - tracepoint(ust_pthread, pthread_mutex_trylock, mutex, retval); + tracepoint(lttng_ust_pthread, pthread_mutex_trylock, mutex, + retval, LTTNG_UST_CALLER_IP()); thread_in_trace = 0; return retval; } @@ -100,7 +111,8 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex) thread_in_trace = 1; retval = mutex_unlock(mutex); - tracepoint(ust_pthread, pthread_mutex_unlock, mutex, retval); + tracepoint(lttng_ust_pthread, pthread_mutex_unlock, mutex, + retval, LTTNG_UST_CALLER_IP()); thread_in_trace = 0; return retval; }