Fix: liblttng-ust-dl ip context
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Jun 2015 11:20:31 +0000 (13:20 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Jun 2015 11:20:31 +0000 (13:20 +0200)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-dl/lttng-ust-dl.c
liblttng-ust-dl/ust_dl.c
liblttng-ust-dl/ust_dl.h

index 13d2b435e6b421f16b802396d48b8c48066fc8a0..d366f64f8f46c2195bd0bc3a1ba8af69b3ec28ec 100644 (file)
@@ -67,7 +67,7 @@ int _lttng_ust_dl_libc_dlclose(void *handle)
 }
 
 static
-void lttng_ust_dl_dlopen(void *so_base, const char *so_name)
+void lttng_ust_dl_dlopen(void *so_base, const char *so_name, void *ip)
 {
        char resolved_path[PATH_MAX];
        struct stat sostat;
@@ -83,7 +83,7 @@ void lttng_ust_dl_dlopen(void *so_base, const char *so_name)
        }
 
        tracepoint(lttng_ust_dl, dlopen,
-               so_base, resolved_path, sostat.st_size, sostat.st_mtime);
+               so_base, resolved_path, sostat.st_size, sostat.st_mtime, ip);
        return;
 }
 
@@ -94,7 +94,8 @@ void *dlopen(const char *filename, int flag)
                struct link_map *p = NULL;
                if (dlinfo(handle, RTLD_DI_LINKMAP, &p) != -1 && p != NULL
                                && p->l_addr != 0)
-                       lttng_ust_dl_dlopen((void *) p->l_addr, p->l_name);
+                       lttng_ust_dl_dlopen((void *) p->l_addr, p->l_name,
+                               __builtin_return_address(0));
        }
        return handle;
 }
@@ -105,7 +106,8 @@ int dlclose(void *handle)
                struct link_map *p = NULL;
                if (dlinfo(handle, RTLD_DI_LINKMAP, &p) != -1 && p != NULL
                                && p->l_addr != 0)
-                       tracepoint(lttng_ust_dl, dlclose, (void *) p->l_addr);
+                       tracepoint(lttng_ust_dl, dlclose, (void *) p->l_addr,
+                               __builtin_return_address(0));
        }
        return _lttng_ust_dl_libc_dlclose(handle);
 }
index f24f1d26a1f183eb4a6b854b0a36b64607b835a2..b25ba7b902a953b84323107ea260cba6a6c914b7 100644 (file)
@@ -18,4 +18,5 @@
 
 #define _LGPL_SOURCE
 #define TRACEPOINT_CREATE_PROBES
+#define TP_IP_PARAM ip
 #include "ust_dl.h"
index 10801898807623d6248067b5a8419fc692144699..ddab530649c42df75e169c70b73dfb4353f934b3 100644 (file)
@@ -37,7 +37,8 @@ extern "C" {
 #include <lttng/tracepoint.h>
 
 TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
-       TP_ARGS(void *, baddr, const char*, sopath, int64_t, size, int64_t, mtime),
+       TP_ARGS(void *, baddr, const char*, sopath, int64_t, size,
+               int64_t, mtime, void *, ip),
        TP_FIELDS(
                ctf_integer_hex(void *, baddr, baddr)
                ctf_string(sopath, sopath)
@@ -47,7 +48,7 @@ TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
 )
 
 TRACEPOINT_EVENT(lttng_ust_dl, dlclose,
-       TP_ARGS(void *, baddr),
+       TP_ARGS(void *, baddr, void *, ip),
        TP_FIELDS(
                ctf_integer_hex(void *, baddr, baddr)
        )
This page took 0.026776 seconds and 4 git commands to generate.