X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ust-libc-wrapper%2Flttng-ust-malloc.c;h=48d37f8185e80fb377e5ec9b8f37eb9204966049;hb=2fbda51c64f28b33b8febffc998af235e6fa9ea9;hp=0306939960ef2a0e1104b4a9a6f8ad417fafc9e7;hpb=fca97dfd73a96bbf964c39e7f3a21fe70cccee96;p=lttng-ust.git diff --git a/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c b/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c index 03069399..48d37f81 100644 --- a/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c +++ b/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c @@ -30,9 +30,12 @@ #include "common/macros.h" #include "common/align.h" -#define TRACEPOINT_DEFINE -#define TRACEPOINT_CREATE_PROBES -#define TP_IP_PARAM ip +#define LTTNG_UST_TRACEPOINT_HIDDEN_DEFINITION +#define LTTNG_UST_TRACEPOINT_PROVIDER_HIDDEN_DEFINITION + +#define LTTNG_UST_TRACEPOINT_DEFINE +#define LTTNG_UST_TRACEPOINT_CREATE_PROBES +#define LTTNG_UST_TP_IP_PARAM ip #include "ust_libc.h" #define STATIC_CALLOC_LEN 4096 @@ -268,7 +271,7 @@ void *malloc(size_t size) } retval = cur_alloc.malloc(size); if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(lttng_ust_libc, malloc, + lttng_ust_tracepoint(lttng_ust_libc, malloc, size, retval, LTTNG_UST_CALLER_IP()); } URCU_TLS(malloc_nesting)--; @@ -288,7 +291,7 @@ void free(void *ptr) } if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(lttng_ust_libc, free, + lttng_ust_tracepoint(lttng_ust_libc, free, ptr, LTTNG_UST_CALLER_IP()); } @@ -318,7 +321,7 @@ void *calloc(size_t nmemb, size_t size) } retval = cur_alloc.calloc(nmemb, size); if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(lttng_ust_libc, calloc, + lttng_ust_tracepoint(lttng_ust_libc, calloc, nmemb, size, retval, LTTNG_UST_CALLER_IP()); } URCU_TLS(malloc_nesting)--; @@ -352,7 +355,7 @@ void *realloc(void *ptr, size_t size) memcpy(retval, ptr, *old_size); } /* - * Mimick that a NULL pointer has been received, so + * Mimic that a NULL pointer has been received, so * memory allocation analysis based on the trace don't * get confused by the address from the static * allocator. @@ -371,7 +374,7 @@ void *realloc(void *ptr, size_t size) retval = cur_alloc.realloc(ptr, size); end: if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(lttng_ust_libc, realloc, + lttng_ust_tracepoint(lttng_ust_libc, realloc, ptr, size, retval, LTTNG_UST_CALLER_IP()); } URCU_TLS(malloc_nesting)--; @@ -392,7 +395,7 @@ void *memalign(size_t alignment, size_t size) } retval = cur_alloc.memalign(alignment, size); if (URCU_TLS(malloc_nesting) == 1) { - tracepoint(lttng_ust_libc, memalign, + lttng_ust_tracepoint(lttng_ust_libc, memalign, alignment, size, retval, LTTNG_UST_CALLER_IP()); } @@ -414,7 +417,7 @@ 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(lttng_ust_libc, posix_memalign, + lttng_ust_tracepoint(lttng_ust_libc, posix_memalign, *memptr, alignment, size, retval, LTTNG_UST_CALLER_IP()); } @@ -423,7 +426,7 @@ int posix_memalign(void **memptr, size_t alignment, size_t size) } static -void lttng_ust_fixup_malloc_nesting_tls(void) +void lttng_ust_malloc_nesting_alloc_tls(void) { asm volatile ("" : : "m" (URCU_TLS(malloc_nesting))); } @@ -434,7 +437,7 @@ void lttng_ust_libc_wrapper_malloc_ctor(void) if (cur_alloc.calloc) { return; } - lttng_ust_fixup_malloc_nesting_tls(); + lttng_ust_malloc_nesting_alloc_tls(); /* * Ensure the allocator is in place before the process becomes * multithreaded.