* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define _LGPL_SOURCE
#define _GNU_SOURCE
+#include <lttng/ust-dlfcn.h>
#include <inttypes.h>
-#include <dlfcn.h>
#include <link.h>
#include <unistd.h>
#include <stdio.h>
void *dlopen(const char *filename, int flag)
{
void *handle = _lttng_ust_dl_libc_dlopen(filename, flag);
- if (handle) {
+ if (__tracepoint_ptrs_registered && handle) {
struct link_map *p = NULL;
if (dlinfo(handle, RTLD_DI_LINKMAP, &p) != -1 && p != NULL
&& p->l_addr != 0)
int dlclose(void *handle)
{
- if (handle) {
+ if (__tracepoint_ptrs_registered && handle) {
struct link_map *p = NULL;
if (dlinfo(handle, RTLD_DI_LINKMAP, &p) != -1 && p != NULL
&& p->l_addr != 0)