Fix: don't call __builtin_return_address(0) on 32-bit powerpc
[lttng-ust.git] / liblttng-ust-dl / lttng-ust-dl.c
index 13d2b435e6b421f16b802396d48b8c48066fc8a0..25912890c3366794dcb8c22fbb92aafd2b7a2b64 100644 (file)
@@ -29,6 +29,7 @@
 #include <signal.h>
 #include <sched.h>
 #include <stdarg.h>
+#include <helper.h>
 #include "usterr-signal-safe.h"
 
 #include <lttng/ust-compiler.h>
@@ -67,7 +68,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 +84,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 +95,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,
+                               LTTNG_UST_CALLER_IP());
        }
        return handle;
 }
@@ -105,7 +107,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,
+                               LTTNG_UST_CALLER_IP());
        }
        return _lttng_ust_dl_libc_dlclose(handle);
 }
This page took 0.024503 seconds and 4 git commands to generate.