From: Mathieu Desnoyers Date: Wed, 10 Jun 2015 11:20:31 +0000 (+0200) Subject: Fix: liblttng-ust-dl ip context X-Git-Tag: v2.6.2~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f89adaae0b269c28768de32ad6ebbd87ed074b27;p=lttng-ust.git Fix: liblttng-ust-dl ip context Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust-dl/ust_baddr.c b/liblttng-ust-dl/ust_baddr.c index f5b95b0b..e407f6aa 100644 --- a/liblttng-ust-dl/ust_baddr.c +++ b/liblttng-ust-dl/ust_baddr.c @@ -18,4 +18,5 @@ #define _LGPL_SOURCE #define TRACEPOINT_CREATE_PROBES +#define TP_IP_PARAM ip #include "ust_baddr.h" diff --git a/liblttng-ust-dl/ust_baddr.h b/liblttng-ust-dl/ust_baddr.h index 2c757f7f..0ca71dbf 100644 --- a/liblttng-ust-dl/ust_baddr.h +++ b/liblttng-ust-dl/ust_baddr.h @@ -37,7 +37,8 @@ extern "C" { #include TRACEPOINT_EVENT(ust_baddr, push, - 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(ust_baddr, push, ) TRACEPOINT_EVENT(ust_baddr, pop, - TP_ARGS(void *, baddr), + TP_ARGS(void *, baddr, void *, ip), TP_FIELDS( ctf_integer_hex(void *, baddr, baddr) ) diff --git a/liblttng-ust-dl/ustdl.c b/liblttng-ust-dl/ustdl.c index b6abca7b..fde537f6 100644 --- a/liblttng-ust-dl/ustdl.c +++ b/liblttng-ust-dl/ustdl.c @@ -67,7 +67,7 @@ int _lttng_ust_dl_libc_dlclose(void *handle) } static -void lttng_ust_baddr_push(void *so_base, const char *so_name) +void lttng_ust_baddr_push(void *so_base, const char *so_name, void *ip) { char resolved_path[PATH_MAX]; struct stat sostat; @@ -83,7 +83,7 @@ void lttng_ust_baddr_push(void *so_base, const char *so_name) } tracepoint(ust_baddr, push, - 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_baddr_push((void *) p->l_addr, p->l_name); + lttng_ust_baddr_push((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(ust_baddr, pop, (void *) p->l_addr); + tracepoint(ust_baddr, pop, (void *) p->l_addr, + __builtin_return_address(0)); } return _lttng_ust_dl_libc_dlclose(handle); }