X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust-dl%2Flttng-ust-dl.c;h=81b5bec470ad91dda754776220b9f5bb9435cf3d;hb=97c7c238f60194565d4839e38e712414c22494e3;hp=e457e7a3cbdfa69697c3794465a82a66681a0ec3;hpb=735ea6a81120f85d94666245f24aac233519568e;p=lttng-ust.git diff --git a/liblttng-ust-dl/lttng-ust-dl.c b/liblttng-ust-dl/lttng-ust-dl.c index e457e7a3..81b5bec4 100644 --- a/liblttng-ust-dl/lttng-ust-dl.c +++ b/liblttng-ust-dl/lttng-ust-dl.c @@ -1,6 +1,7 @@ /* * Copyright (C) 2013 Paul Woegerer * Copyright (C) 2015 Antoine Busque + * Copyright (C) 2016 Mathieu Desnoyers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +27,7 @@ #include #include +#include #include #include "usterr-signal-safe.h" @@ -135,19 +137,21 @@ 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, + lttng_ust_dl_dlopen((void *) p->l_addr, + p->l_name, LTTNG_UST_CALLER_IP()); } } - + lttng_ust_dl_update(LTTNG_UST_CALLER_IP()); return handle; } int dlclose(void *handle) { + int ret; + 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) { @@ -156,6 +160,7 @@ int dlclose(void *handle) (void *) p->l_addr); } } - - return _lttng_ust_dl_libc_dlclose(handle); + ret = _lttng_ust_dl_libc_dlclose(handle); + lttng_ust_dl_update(LTTNG_UST_CALLER_IP()); + return ret; }