X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust-dl%2Flttng-ust-dl.c;h=e457e7a3cbdfa69697c3794465a82a66681a0ec3;hb=f53329f3d1489c6241f8606954835357a56a9eab;hp=d6abeff0820e024d1a6512213df5c8ec6a5e539f;hpb=83215d66bbc361b174835895a3f6166e7c2fcd86;p=lttng-ust.git diff --git a/liblttng-ust-dl/lttng-ust-dl.c b/liblttng-ust-dl/lttng-ust-dl.c index d6abeff0..e457e7a3 100644 --- a/liblttng-ust-dl/lttng-ust-dl.c +++ b/liblttng-ust-dl/lttng-ust-dl.c @@ -17,9 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define _LGPL_SOURCE #define _GNU_SOURCE - +#define _LGPL_SOURCE #include #include #include @@ -27,6 +26,7 @@ #include #include +#include #include "usterr-signal-safe.h" /* Include link.h last else it conflicts with ust-dlfcn. */ @@ -104,18 +104,17 @@ void lttng_ust_dl_dlopen(void *so_base, const char *so_name, void *ip) } tracepoint(lttng_ust_dl, dlopen, - ip, so_base, resolved_path, memsz); + ip, so_base, resolved_path, memsz, + has_build_id, has_debug_link); if (has_build_id) { tracepoint(lttng_ust_dl, build_id, ip, so_base, build_id, build_id_len); - free(build_id); } if (has_debug_link) { tracepoint(lttng_ust_dl, debug_link, ip, so_base, dbg_file, crc); - free(dbg_file); } end: @@ -137,7 +136,7 @@ void *dlopen(const char *filename, int flag) ret = dlinfo(handle, RTLD_DI_LINKMAP, &p); if (ret != -1 && p != NULL && p->l_addr != 0) { lttng_ust_dl_dlopen((void *) p->l_addr, p->l_name, - __builtin_return_address(0)); + LTTNG_UST_CALLER_IP()); } } @@ -146,14 +145,14 @@ void *dlopen(const char *filename, int flag) int dlclose(void *handle) { - if (__tracepoint_ptrs_registered && handle) { + if (__tracepoint_ptrs_registered) { struct link_map *p = NULL; int ret; ret = dlinfo(handle, RTLD_DI_LINKMAP, &p); if (ret != -1 && p != NULL && p->l_addr != 0) { tracepoint(lttng_ust_dl, dlclose, - __builtin_return_address(0), + LTTNG_UST_CALLER_IP(), (void *) p->l_addr); } }