Fix: pthread wrapper ip context
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Jun 2015 11:15:28 +0000 (13:15 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Jun 2015 11:15:28 +0000 (13:15 +0200)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-libc-wrapper/lttng-ust-pthread.c
liblttng-ust-libc-wrapper/ust_pthread.h

index 97e3eb88a4ba37328b9fd1c63b25c9cd3f56d28e..fd3af1105a961422e276671a483b18c81a80389a 100644 (file)
@@ -22,6 +22,7 @@
 
 #define TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
+#define TP_IP_PARAM ip
 #include "ust_pthread.h"
 
 static __thread int thread_in_trace;
@@ -46,9 +47,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,
+               __builtin_return_address(0));
        retval = mutex_lock(mutex);
-       tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex, retval);
+       tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex,
+               retval, __builtin_return_address(0));
        thread_in_trace = 0;
        return retval;
 }
@@ -74,7 +77,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, __builtin_return_address(0));
        thread_in_trace = 0;
        return retval;
 }
@@ -100,7 +104,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, __builtin_return_address(0));
        thread_in_trace = 0;
        return retval;
 }
index 795cf9a235374dab17d7869e97ac18137b561038..b6786210899a51a27cdee8bf1cb810c570c45cb5 100644 (file)
@@ -33,14 +33,14 @@ extern "C" {
 #include <lttng/tracepoint.h>
 
 TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_req,
-       TP_ARGS(pthread_mutex_t *, mutex),
+       TP_ARGS(pthread_mutex_t *, mutex, void *, ip),
        TP_FIELDS(
                ctf_integer_hex(void *, mutex, mutex)
        )
 )
 
 TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_acq,
-       TP_ARGS(pthread_mutex_t *, mutex, int, status),
+       TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
        TP_FIELDS(
                ctf_integer_hex(void *, mutex, mutex)
                ctf_integer(int, status, status)
@@ -48,7 +48,7 @@ TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_acq,
 )
 
 TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_trylock,
-       TP_ARGS(pthread_mutex_t *, mutex, int, status),
+       TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
        TP_FIELDS(
                ctf_integer_hex(void *, mutex, mutex)
                ctf_integer(int, status, status)
@@ -56,7 +56,7 @@ TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_trylock,
 )
 
 TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_unlock,
-       TP_ARGS(pthread_mutex_t *, mutex, int, status),
+       TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
        TP_FIELDS(
                ctf_integer_hex(void *, mutex, mutex)
                ctf_integer(int, status, status)
This page took 0.027575 seconds and 4 git commands to generate.