From 6d4658aa879ddabdd79fc6c637ee039413ad215b Mon Sep 17 00:00:00 2001 From: Antoine Busque Date: Mon, 25 May 2015 19:17:09 -0400 Subject: [PATCH] Rename helper providers and events for consistency This patch renders uniform the provider names of UST helpers by making them all start with the "lttng_ust_" prefix. Also, the helper formerly known as "ust_baddr" is now "lttng_ust_dl", and its "push" and "pop" events are now "dlopen" and "dlclose", respectively. This is in line with the other helpers, for which the name of the provider reflects the name of the library, and the names of events correspond to those of the traced functions. Signed-off-by: Antoine Busque Signed-off-by: Mathieu Desnoyers --- liblttng-ust-dl/Makefile.am | 6 +++--- liblttng-ust-dl/{ustdl.c => lttng-ust-dl.c} | 10 ++++----- liblttng-ust-dl/{ust_baddr.c => ust_dl.c} | 2 +- liblttng-ust-dl/{ust_baddr.h => ust_dl.h} | 16 +++++++------- liblttng-ust-libc-wrapper/lttng-ust-malloc.c | 21 ++++++++++++------- liblttng-ust-libc-wrapper/lttng-ust-pthread.c | 8 +++---- liblttng-ust-libc-wrapper/ust_libc.h | 14 ++++++------- liblttng-ust-libc-wrapper/ust_pthread.h | 10 ++++----- 8 files changed, 47 insertions(+), 40 deletions(-) rename liblttng-ust-dl/{ustdl.c => lttng-ust-dl.c} (92%) rename liblttng-ust-dl/{ust_baddr.c => ust_dl.c} (97%) rename liblttng-ust-dl/{ust_baddr.h => ust_dl.h} (84%) diff --git a/liblttng-ust-dl/Makefile.am b/liblttng-ust-dl/Makefile.am index b8ea2a39..049ac655 100644 --- a/liblttng-ust-dl/Makefile.am +++ b/liblttng-ust-dl/Makefile.am @@ -3,9 +3,9 @@ AM_CFLAGS = -fno-strict-aliasing lib_LTLIBRARIES = liblttng-ust-dl.la liblttng_ust_dl_la_SOURCES = \ - ustdl.c \ - ust_baddr.c \ - ust_baddr.h + lttng-ust-dl.c \ + ust_dl.c \ + ust_dl.h liblttng_ust_dl_la_LIBADD = \ $(top_builddir)/liblttng-ust/liblttng-ust.la diff --git a/liblttng-ust-dl/ustdl.c b/liblttng-ust-dl/lttng-ust-dl.c similarity index 92% rename from liblttng-ust-dl/ustdl.c rename to liblttng-ust-dl/lttng-ust-dl.c index 1ef84c37..13d2b435 100644 --- a/liblttng-ust-dl/ustdl.c +++ b/liblttng-ust-dl/lttng-ust-dl.c @@ -35,7 +35,7 @@ #include #define TRACEPOINT_DEFINE -#include "ust_baddr.h" +#include "ust_dl.h" static void *(*__lttng_ust_plibc_dlopen)(const char *filename, int flag); static int (*__lttng_ust_plibc_dlclose)(void *handle); @@ -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_dl_dlopen(void *so_base, const char *so_name) { char resolved_path[PATH_MAX]; struct stat sostat; @@ -82,7 +82,7 @@ void lttng_ust_baddr_push(void *so_base, const char *so_name) return; } - tracepoint(ust_baddr, push, + tracepoint(lttng_ust_dl, dlopen, so_base, resolved_path, sostat.st_size, sostat.st_mtime); return; } @@ -94,7 +94,7 @@ 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_dl_dlopen((void *) p->l_addr, p->l_name); } return handle; } @@ -105,7 +105,7 @@ 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(lttng_ust_dl, dlclose, (void *) p->l_addr); } return _lttng_ust_dl_libc_dlclose(handle); } diff --git a/liblttng-ust-dl/ust_baddr.c b/liblttng-ust-dl/ust_dl.c similarity index 97% rename from liblttng-ust-dl/ust_baddr.c rename to liblttng-ust-dl/ust_dl.c index f5b95b0b..f24f1d26 100644 --- a/liblttng-ust-dl/ust_baddr.c +++ b/liblttng-ust-dl/ust_dl.c @@ -18,4 +18,4 @@ #define _LGPL_SOURCE #define TRACEPOINT_CREATE_PROBES -#include "ust_baddr.h" +#include "ust_dl.h" diff --git a/liblttng-ust-dl/ust_baddr.h b/liblttng-ust-dl/ust_dl.h similarity index 84% rename from liblttng-ust-dl/ust_baddr.h rename to liblttng-ust-dl/ust_dl.h index 2c757f7f..10801898 100644 --- a/liblttng-ust-dl/ust_baddr.h +++ b/liblttng-ust-dl/ust_dl.h @@ -1,8 +1,8 @@ #undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER ust_baddr +#define TRACEPOINT_PROVIDER lttng_ust_dl -#if !defined(_TRACEPOINT_UST_BADDR_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_UST_BADDR_H +#if !defined(_TRACEPOINT_UST_DL_H) || defined(TRACEPOINT_HEADER_MULTI_READ) +#define _TRACEPOINT_UST_DL_H #ifdef __cplusplus extern "C" { @@ -33,10 +33,10 @@ extern "C" { #include #include -#define LTTNG_UST_BADDR_PROVIDER +#define LTTNG_UST_DL_PROVIDER #include -TRACEPOINT_EVENT(ust_baddr, push, +TRACEPOINT_EVENT(lttng_ust_dl, dlopen, TP_ARGS(void *, baddr, const char*, sopath, int64_t, size, int64_t, mtime), TP_FIELDS( ctf_integer_hex(void *, baddr, baddr) @@ -46,17 +46,17 @@ TRACEPOINT_EVENT(ust_baddr, push, ) ) -TRACEPOINT_EVENT(ust_baddr, pop, +TRACEPOINT_EVENT(lttng_ust_dl, dlclose, TP_ARGS(void *, baddr), TP_FIELDS( ctf_integer_hex(void *, baddr, baddr) ) ) -#endif /* _TRACEPOINT_UST_BADDR_H */ +#endif /* _TRACEPOINT_UST_DL_H */ #undef TRACEPOINT_INCLUDE -#define TRACEPOINT_INCLUDE "./ust_baddr.h" +#define TRACEPOINT_INCLUDE "./ust_dl.h" /* This part must be outside ifdef protection */ #include diff --git a/liblttng-ust-libc-wrapper/lttng-ust-malloc.c b/liblttng-ust-libc-wrapper/lttng-ust-malloc.c index 14545c2a..652dd5ae 100644 --- a/liblttng-ust-libc-wrapper/lttng-ust-malloc.c +++ b/liblttng-ust-libc-wrapper/lttng-ust-malloc.c @@ -9,7 +9,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public @@ -260,7 +260,8 @@ void *malloc(size_t size) } retval = cur_alloc.malloc(size); if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(ust_libc, malloc, size, retval, __builtin_return_address(0)); + tracepoint(lttng_ust_libc, malloc, + size, retval, __builtin_return_address(0)); } URCU_TLS(malloc_nesting)--; return retval; @@ -279,7 +280,8 @@ void free(void *ptr) } if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(ust_libc, free, ptr, __builtin_return_address(0)); + tracepoint(lttng_ust_libc, free, + ptr, __builtin_return_address(0)); } if (cur_alloc.free == NULL) { @@ -308,7 +310,8 @@ void *calloc(size_t nmemb, size_t size) } retval = cur_alloc.calloc(nmemb, size); if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(ust_libc, calloc, nmemb, size, retval, __builtin_return_address(0)); + tracepoint(lttng_ust_libc, calloc, + nmemb, size, retval, __builtin_return_address(0)); } URCU_TLS(malloc_nesting)--; return retval; @@ -360,7 +363,8 @@ void *realloc(void *ptr, size_t size) retval = cur_alloc.realloc(ptr, size); end: if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(ust_libc, realloc, ptr, size, retval, __builtin_return_address(0)); + tracepoint(lttng_ust_libc, realloc, + ptr, size, retval, __builtin_return_address(0)); } URCU_TLS(malloc_nesting)--; return retval; @@ -380,7 +384,9 @@ void *memalign(size_t alignment, size_t size) } retval = cur_alloc.memalign(alignment, size); if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(ust_libc, memalign, alignment, size, retval, __builtin_return_address(0)); + tracepoint(lttng_ust_libc, memalign, + alignment, size, retval, + __builtin_return_address(0)); } URCU_TLS(malloc_nesting)--; return retval; @@ -400,7 +406,8 @@ int posix_memalign(void **memptr, size_t alignment, size_t size) } retval = cur_alloc.posix_memalign(memptr, alignment, size); if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(ust_libc, posix_memalign, *memptr, alignment, size, + tracepoint(lttng_ust_libc, posix_memalign, + *memptr, alignment, size, retval, __builtin_return_address(0)); } URCU_TLS(malloc_nesting)--; diff --git a/liblttng-ust-libc-wrapper/lttng-ust-pthread.c b/liblttng-ust-libc-wrapper/lttng-ust-pthread.c index 45789aa3..97e3eb88 100644 --- a/liblttng-ust-libc-wrapper/lttng-ust-pthread.c +++ b/liblttng-ust-libc-wrapper/lttng-ust-pthread.c @@ -46,9 +46,9 @@ int pthread_mutex_lock(pthread_mutex_t *mutex) } thread_in_trace = 1; - tracepoint(ust_pthread, pthread_mutex_lock_req, mutex); + tracepoint(lttng_ust_pthread, pthread_mutex_lock_req, mutex); retval = mutex_lock(mutex); - tracepoint(ust_pthread, pthread_mutex_lock_acq, mutex, retval); + tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex, retval); thread_in_trace = 0; return retval; } @@ -74,7 +74,7 @@ int pthread_mutex_trylock(pthread_mutex_t *mutex) thread_in_trace = 1; retval = mutex_trylock(mutex); - tracepoint(ust_pthread, pthread_mutex_trylock, mutex, retval); + tracepoint(lttng_ust_pthread, pthread_mutex_trylock, mutex, retval); thread_in_trace = 0; return retval; } @@ -100,7 +100,7 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex) thread_in_trace = 1; retval = mutex_unlock(mutex); - tracepoint(ust_pthread, pthread_mutex_unlock, mutex, retval); + tracepoint(lttng_ust_pthread, pthread_mutex_unlock, mutex, retval); thread_in_trace = 0; return retval; } diff --git a/liblttng-ust-libc-wrapper/ust_libc.h b/liblttng-ust-libc-wrapper/ust_libc.h index 222da2d3..ab190e84 100644 --- a/liblttng-ust-libc-wrapper/ust_libc.h +++ b/liblttng-ust-libc-wrapper/ust_libc.h @@ -1,5 +1,5 @@ #undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER ust_libc +#define TRACEPOINT_PROVIDER lttng_ust_libc #if !defined(_TRACEPOINT_UST_LIBC_H) || defined(TRACEPOINT_HEADER_MULTI_READ) #define _TRACEPOINT_UST_LIBC_H @@ -32,7 +32,7 @@ extern "C" { #include -TRACEPOINT_EVENT(ust_libc, malloc, +TRACEPOINT_EVENT(lttng_ust_libc, malloc, TP_ARGS(size_t, size, void *, ptr, void *, caller), TP_FIELDS( ctf_integer(size_t, size, size) @@ -41,7 +41,7 @@ TRACEPOINT_EVENT(ust_libc, malloc, ) ) -TRACEPOINT_EVENT(ust_libc, free, +TRACEPOINT_EVENT(lttng_ust_libc, free, TP_ARGS(void *, ptr, void *, caller), TP_FIELDS( ctf_integer_hex(void *, ptr, ptr) @@ -49,7 +49,7 @@ TRACEPOINT_EVENT(ust_libc, free, ) ) -TRACEPOINT_EVENT(ust_libc, calloc, +TRACEPOINT_EVENT(lttng_ust_libc, calloc, TP_ARGS(size_t, nmemb, size_t, size, void *, ptr, void *, caller), TP_FIELDS( ctf_integer(size_t, nmemb, nmemb) @@ -59,7 +59,7 @@ TRACEPOINT_EVENT(ust_libc, calloc, ) ) -TRACEPOINT_EVENT(ust_libc, realloc, +TRACEPOINT_EVENT(lttng_ust_libc, realloc, TP_ARGS(void *, in_ptr, size_t, size, void *, ptr, void *, caller), TP_FIELDS( ctf_integer_hex(void *, in_ptr, in_ptr) @@ -69,7 +69,7 @@ TRACEPOINT_EVENT(ust_libc, realloc, ) ) -TRACEPOINT_EVENT(ust_libc, memalign, +TRACEPOINT_EVENT(lttng_ust_libc, memalign, TP_ARGS(size_t, alignment, size_t, size, void *, ptr, void *, caller), TP_FIELDS( ctf_integer(size_t, alignment, alignment) @@ -79,7 +79,7 @@ TRACEPOINT_EVENT(ust_libc, memalign, ) ) -TRACEPOINT_EVENT(ust_libc, posix_memalign, +TRACEPOINT_EVENT(lttng_ust_libc, posix_memalign, TP_ARGS(void *, out_ptr, size_t, alignment, size_t, size, int, result, void *, caller), TP_FIELDS( ctf_integer_hex(void *, out_ptr, out_ptr) diff --git a/liblttng-ust-libc-wrapper/ust_pthread.h b/liblttng-ust-libc-wrapper/ust_pthread.h index 7d35c3a0..795cf9a2 100644 --- a/liblttng-ust-libc-wrapper/ust_pthread.h +++ b/liblttng-ust-libc-wrapper/ust_pthread.h @@ -1,5 +1,5 @@ #undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER ust_pthread +#define TRACEPOINT_PROVIDER lttng_ust_pthread #if !defined(_TRACEPOINT_UST_PTHREAD_H) || defined(TRACEPOINT_HEADER_MULTI_READ) #define _TRACEPOINT_UST_PTHREAD_H @@ -32,14 +32,14 @@ extern "C" { #include -TRACEPOINT_EVENT(ust_pthread, pthread_mutex_lock_req, +TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_req, TP_ARGS(pthread_mutex_t *, mutex), TP_FIELDS( ctf_integer_hex(void *, mutex, mutex) ) ) -TRACEPOINT_EVENT(ust_pthread, pthread_mutex_lock_acq, +TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_acq, TP_ARGS(pthread_mutex_t *, mutex, int, status), TP_FIELDS( ctf_integer_hex(void *, mutex, mutex) @@ -47,7 +47,7 @@ TRACEPOINT_EVENT(ust_pthread, pthread_mutex_lock_acq, ) ) -TRACEPOINT_EVENT(ust_pthread, pthread_mutex_trylock, +TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_trylock, TP_ARGS(pthread_mutex_t *, mutex, int, status), TP_FIELDS( ctf_integer_hex(void *, mutex, mutex) @@ -55,7 +55,7 @@ TRACEPOINT_EVENT(ust_pthread, pthread_mutex_trylock, ) ) -TRACEPOINT_EVENT(ust_pthread, pthread_mutex_unlock, +TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_unlock, TP_ARGS(pthread_mutex_t *, mutex, int, status), TP_FIELDS( ctf_integer_hex(void *, mutex, mutex) -- 2.34.1