Cleanup: standardise include path
[lttng-ust.git] / liblttng-ust-libc-wrapper / lttng-ust-pthread.c
index 97e3eb88a4ba37328b9fd1c63b25c9cd3f56d28e..1e65207f8bc007e69539e3220cca7a89f1e69d67 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#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 <lttng/ust-dlfcn.h>
+#include <helper.h>
 #include <pthread.h>
 
 #define TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
+#define TP_IP_PARAM ip
 #include "ust_pthread.h"
 
 static __thread int thread_in_trace;
@@ -46,9 +52,11 @@ int pthread_mutex_lock(pthread_mutex_t *mutex)
        }
 
        thread_in_trace = 1;
-       tracepoint(lttng_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(lttng_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 +82,8 @@ int pthread_mutex_trylock(pthread_mutex_t *mutex)
 
        thread_in_trace = 1;
        retval = mutex_trylock(mutex);
-       tracepoint(lttng_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 +109,8 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex)
 
        thread_in_trace = 1;
        retval = mutex_unlock(mutex);
-       tracepoint(lttng_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;
 }
This page took 0.036936 seconds and 4 git commands to generate.