From cbc06a3bd9abe653eaf278cdf4be8bf28dcca267 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 16 Apr 2021 09:36:07 -0400 Subject: [PATCH] Introduce API compatibility macros Introduce API compatibility macros, allowing to compile-out backward compatibility for older API major versions. The initial use-case introduced here is renaming of the tracepoint(), do_tracepoint() and tracepoint_enabled() macros to add the lttng_ust_ prefix. The old macros are only defined when API compatibility with soname 0 is enabled. Signed-off-by: Mathieu Desnoyers Change-Id: I39e5eb4ae6ceea91dd039d52c429a791bb11ce66 --- doc/examples/demo/demo.c | 8 ++--- doc/examples/easy-ust/sample.c | 2 +- doc/examples/gen-tp/sample.c | 2 +- doc/examples/hello-static-lib/hello.c | 4 +-- include/Makefile.am | 1 + include/lttng/tracepoint.h | 21 ++++++++----- include/lttng/ust-api-compat.h | 31 +++++++++++++++++++ .../lttng-ust-cyg-profile-fast.c | 4 +-- .../lttng-ust-cyg-profile.c | 4 +-- src/lib/lttng-ust-dl/lttng-ust-dl.c | 14 ++++----- .../jni/jul/lttng_ust_jul.c | 4 +-- .../jni/log4j/lttng_ust_log4j.c | 4 +-- src/lib/lttng-ust-java/LTTngUst.c | 10 +++--- .../lttng-ust-libc-wrapper/lttng-ust-malloc.c | 12 +++---- .../lttng-ust-pthread.c | 8 ++--- .../lttng-ust-python-agent/lttng_ust_python.c | 2 +- src/lib/lttng-ust/lttng-ust-statedump.c | 20 ++++++------ tests/benchmark/bench.c | 2 +- tests/compile/ctf-types/ctf-types.c | 4 +-- tests/compile/hello-many/hello-many.c | 4 +-- tests/compile/hello/hello.c | 4 +-- .../same_line_tracepoint.c | 2 +- tests/compile/test-app-ctx/hello.c | 4 +-- 23 files changed, 105 insertions(+), 66 deletions(-) create mode 100644 include/lttng/ust-api-compat.h diff --git a/doc/examples/demo/demo.c b/doc/examples/demo/demo.c index 7a16125a..aa54055b 100644 --- a/doc/examples/demo/demo.c +++ b/doc/examples/demo/demo.c @@ -40,14 +40,14 @@ int main(int argc, char **argv) sleep(delay); fprintf(stderr, "Tracing... "); - tracepoint(ust_tests_demo, starting, 123); + lttng_ust_tracepoint(ust_tests_demo, starting, 123); for (i = 0; i < 5; i++) { netint = htonl(i); - tracepoint(ust_tests_demo2, loop, i, netint, values, + lttng_ust_tracepoint(ust_tests_demo2, loop, i, netint, values, text, strlen(text), dbl, flt); } - tracepoint(ust_tests_demo, done, 456); - tracepoint(ust_tests_demo3, done, 42); + lttng_ust_tracepoint(ust_tests_demo, done, 456); + lttng_ust_tracepoint(ust_tests_demo3, done, 42); fprintf(stderr, " done.\n"); return 0; } diff --git a/doc/examples/easy-ust/sample.c b/doc/examples/easy-ust/sample.c index 36509ebc..542a8f62 100644 --- a/doc/examples/easy-ust/sample.c +++ b/doc/examples/easy-ust/sample.c @@ -19,7 +19,7 @@ int main(void) int i = 0; for (i = 0; i < 100000; i++) { - tracepoint(sample_component, message, "Hello World"); + lttng_ust_tracepoint(sample_component, message, "Hello World"); usleep(1); } return 0; diff --git a/doc/examples/gen-tp/sample.c b/doc/examples/gen-tp/sample.c index e56c332e..52c4a9eb 100644 --- a/doc/examples/gen-tp/sample.c +++ b/doc/examples/gen-tp/sample.c @@ -13,7 +13,7 @@ int main(void) int i = 0; for (i = 0; i < 100000; i++) { - tracepoint(sample_tracepoint, message, "Hello World\n"); + lttng_ust_tracepoint(sample_tracepoint, message, "Hello World\n"); usleep(1); } return 0; diff --git a/doc/examples/hello-static-lib/hello.c b/doc/examples/hello-static-lib/hello.c index 8121d1fe..4c339715 100644 --- a/doc/examples/hello-static-lib/hello.c +++ b/doc/examples/hello-static-lib/hello.c @@ -24,7 +24,7 @@ static void inthandler(int sig __attribute__((unused))) { printf("in SIGUSR1 handler\n"); - tracepoint(ust_tests_hello, tptest_sighandler); + lttng_ust_tracepoint(ust_tests_hello, tptest_sighandler); } static @@ -76,7 +76,7 @@ int main(int argc, char **argv) fprintf(stderr, "Tracing... "); for (i = 0; i < 1000000; i++) { netint = htonl(i); - tracepoint(ust_tests_hello, tptest, i, netint, values, + lttng_ust_tracepoint(ust_tests_hello, tptest, i, netint, values, text, strlen(text), dbl, flt); } fprintf(stderr, " done.\n"); diff --git a/include/Makefile.am b/include/Makefile.am index 72239e5a..83030c5c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -13,6 +13,7 @@ nobase_include_HEADERS = \ lttng/ust-tracepoint-event-reset.h \ lttng/ust-tracepoint-event-write.h \ lttng/ust-tracepoint-event-nowrite.h \ + lttng/ust-api-compat.h \ lttng/ust-arch.h \ lttng/ust-events.h \ lttng/ust-common.h \ diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 98c3c8dd..96e01605 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -19,6 +19,7 @@ #include /* for sdt */ #include #include +#include #define LTTNG_UST_TRACEPOINT_NAME_LEN_MAX 256 @@ -49,17 +50,17 @@ extern "C" { #endif -#define tracepoint_enabled(provider, name) \ +#define lttng_ust_tracepoint_enabled(provider, name) \ caa_unlikely(CMM_LOAD_SHARED(__tracepoint_##provider##___##name.state)) -#define do_tracepoint(provider, name, ...) \ +#define lttng_ust_do_tracepoint(provider, name, ...) \ __tracepoint_cb_##provider##___##name(__VA_ARGS__) -#define tracepoint(provider, name, ...) \ - do { \ - LTTNG_UST_STAP_PROBEV(provider, name, ## __VA_ARGS__); \ - if (tracepoint_enabled(provider, name)) \ - do_tracepoint(provider, name, __VA_ARGS__); \ +#define lttng_ust_tracepoint(provider, name, ...) \ + do { \ + LTTNG_UST_STAP_PROBEV(provider, name, ## __VA_ARGS__); \ + if (lttng_ust_tracepoint_enabled(provider, name)) \ + lttng_ust_do_tracepoint(provider, name, __VA_ARGS__); \ } while (0) #define TP_ARGS(...) __VA_ARGS__ @@ -567,6 +568,12 @@ __tracepoints__ptrs_destroy(void) #endif /* #else TRACEPOINT_DEFINE */ +#if LTTNG_UST_COMPAT_API(0) +#define tracepoint lttng_ust_tracepoint +#define do_tracepoint lttng_ust_do_tracepoint +#define tracepoint_enabled lttng_ust_tracepoint_enabled +#endif /* #if LTTNG_UST_COMPAT_API(0) */ + #ifdef __cplusplus } #endif diff --git a/include/lttng/ust-api-compat.h b/include/lttng/ust-api-compat.h new file mode 100644 index 00000000..af9c272b --- /dev/null +++ b/include/lttng/ust-api-compat.h @@ -0,0 +1,31 @@ +/* + * SPDX-License-Identifier: MIT + * + * Copyright (C) 2021 Mathieu Desnoyers + * + * LTTng-UST API compatibility header + */ + +#ifndef _LTTNG_UST_API_COMPAT_H +#define _LTTNG_UST_API_COMPAT_H + +/* + * In order to disable compatibility API for a range of soname major + * versions, define LTTNG_UST_COMPAT_API_VERSION to the oldest major + * version API for which to provide compatibility. + * + * If LTTNG_UST_COMPAT_API_VERSION is undefined, API compatibility for + * all API versions is provided. + * If LTTNG_UST_COMPAT_API_VERSION is defined to N, API compatibility + * for soname N or higher is provided, leaving out (not compiling) + * compatibility for soname lower than N. + */ + +#ifndef LTTNG_UST_COMPAT_API_VERSION +#define LTTNG_UST_COMPAT_API_VERSION 0 +#endif + +#define LTTNG_UST_COMPAT_API(major) \ + (LTTNG_UST_COMPAT_API_VERSION <= (major)) + +#endif /* _LTTNG_UST_API_COMPAT_H */ diff --git a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c index bee7ac04..f5396b41 100644 --- a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c +++ b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c @@ -22,10 +22,10 @@ void __cyg_profile_func_exit(void *this_fn, void *call_site) void __cyg_profile_func_enter(void *this_fn, void *call_site __attribute__((unused))) { - tracepoint(lttng_ust_cyg_profile_fast, func_entry, this_fn); + lttng_ust_tracepoint(lttng_ust_cyg_profile_fast, func_entry, this_fn); } void __cyg_profile_func_exit(void *this_fn, void *call_site __attribute__((unused))) { - tracepoint(lttng_ust_cyg_profile_fast, func_exit, this_fn); + lttng_ust_tracepoint(lttng_ust_cyg_profile_fast, func_exit, this_fn); } diff --git a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c index e81e1154..c7d3d5ee 100644 --- a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c +++ b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c @@ -22,10 +22,10 @@ void __cyg_profile_func_exit(void *this_fn, void *call_site) void __cyg_profile_func_enter(void *this_fn, void *call_site) { - tracepoint(lttng_ust_cyg_profile, func_entry, this_fn, call_site); + lttng_ust_tracepoint(lttng_ust_cyg_profile, func_entry, this_fn, call_site); } void __cyg_profile_func_exit(void *this_fn, void *call_site) { - tracepoint(lttng_ust_cyg_profile, func_exit, this_fn, call_site); + lttng_ust_tracepoint(lttng_ust_cyg_profile, func_exit, this_fn, call_site); } diff --git a/src/lib/lttng-ust-dl/lttng-ust-dl.c b/src/lib/lttng-ust-dl/lttng-ust-dl.c index e07136ce..8470dfa3 100644 --- a/src/lib/lttng-ust-dl/lttng-ust-dl.c +++ b/src/lib/lttng-ust-dl/lttng-ust-dl.c @@ -118,17 +118,17 @@ void lttng_ust_dl_dlopen(void *so_base, const char *so_name, goto end; } - tracepoint(lttng_ust_dl, dlopen, + lttng_ust_tracepoint(lttng_ust_dl, dlopen, ip, so_base, resolved_path, flags, memsz, has_build_id, has_debug_link); if (has_build_id) { - tracepoint(lttng_ust_dl, build_id, + lttng_ust_tracepoint(lttng_ust_dl, build_id, ip, so_base, build_id, build_id_len); } if (has_debug_link) { - tracepoint(lttng_ust_dl, debug_link, + lttng_ust_tracepoint(lttng_ust_dl, debug_link, ip, so_base, dbg_file, crc); } @@ -180,17 +180,17 @@ void lttng_ust_dl_dlmopen(void *so_base, Lmid_t nsid, const char *so_name, goto end; } - tracepoint(lttng_ust_dl, dlmopen, + lttng_ust_tracepoint(lttng_ust_dl, dlmopen, ip, so_base, nsid, resolved_path, flags, memsz, has_build_id, has_debug_link); if (has_build_id) { - tracepoint(lttng_ust_dl, build_id, + lttng_ust_tracepoint(lttng_ust_dl, build_id, ip, so_base, build_id, build_id_len); } if (has_debug_link) { - tracepoint(lttng_ust_dl, debug_link, + lttng_ust_tracepoint(lttng_ust_dl, debug_link, ip, so_base, dbg_file, crc); } @@ -253,7 +253,7 @@ int dlclose(void *handle) ret = dlinfo(handle, RTLD_DI_LINKMAP, &p); if (ret != -1 && p != NULL && p->l_addr != 0) { - tracepoint(lttng_ust_dl, dlclose, + lttng_ust_tracepoint(lttng_ust_dl, dlclose, LTTNG_UST_CALLER_IP(), (void *) p->l_addr); } diff --git a/src/lib/lttng-ust-java-agent/jni/jul/lttng_ust_jul.c b/src/lib/lttng-ust-java-agent/jni/jul/lttng_ust_jul.c index afc9f111..c1f4db86 100644 --- a/src/lib/lttng-ust-java-agent/jni/jul/lttng_ust_jul.c +++ b/src/lib/lttng-ust-java-agent/jni/jul/lttng_ust_jul.c @@ -33,7 +33,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_jul_LttngJulApi_tracepoint(JNIEn const char *class_name_cstr = (*env)->GetStringUTFChars(env, class_name, &iscopy); const char *method_name_cstr = (*env)->GetStringUTFChars(env, method_name, &iscopy); - tracepoint(lttng_jul, event, msg_cstr, logger_name_cstr, + lttng_ust_tracepoint(lttng_jul, event, msg_cstr, logger_name_cstr, class_name_cstr, method_name_cstr, millis, log_level, thread_id); (*env)->ReleaseStringUTFChars(env, msg, msg_cstr); @@ -76,7 +76,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_jul_LttngJulApi_tracepointWithCo lttng_ust_context_info_tls.ctx_strings = context_info_strings_array; lttng_ust_context_info_tls.ctx_strings_len = (*env)->GetArrayLength(env, context_info_strings); - tracepoint(lttng_jul, event, msg_cstr, logger_name_cstr, + lttng_ust_tracepoint(lttng_jul, event, msg_cstr, logger_name_cstr, class_name_cstr, method_name_cstr, millis, log_level, thread_id); lttng_ust_context_info_tls.ctx_entries = NULL; diff --git a/src/lib/lttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c b/src/lib/lttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c index e88235a6..dea4bb96 100644 --- a/src/lib/lttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c +++ b/src/lib/lttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c @@ -37,7 +37,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_log4j_LttngLog4jApi_tracepoint(J const char *file_name_cstr = (*env)->GetStringUTFChars(env, file_name, &iscopy); const char *thread_name_cstr = (*env)->GetStringUTFChars(env, thread_name, &iscopy); - tracepoint(lttng_log4j, event, msg_cstr, logger_name_cstr, + lttng_ust_tracepoint(lttng_log4j, event, msg_cstr, logger_name_cstr, class_name_cstr, method_name_cstr, file_name_cstr, line_number, timestamp, loglevel, thread_name_cstr); @@ -87,7 +87,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_log4j_LttngLog4jApi_tracepointWi lttng_ust_context_info_tls.ctx_strings = context_info_strings_array; lttng_ust_context_info_tls.ctx_strings_len = (*env)->GetArrayLength(env, context_info_strings); - tracepoint(lttng_log4j, event, msg_cstr, logger_name_cstr, + lttng_ust_tracepoint(lttng_log4j, event, msg_cstr, logger_name_cstr, class_name_cstr, method_name_cstr, file_name_cstr, line_number, timestamp, loglevel, thread_name_cstr); diff --git a/src/lib/lttng-ust-java/LTTngUst.c b/src/lib/lttng-ust-java/LTTngUst.c index f5e0c96b..5985bc41 100644 --- a/src/lib/lttng-ust-java/LTTngUst.c +++ b/src/lib/lttng-ust-java/LTTngUst.c @@ -19,7 +19,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointInt(JNIEnv *env, jboolean iscopy; const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); - tracepoint(lttng_ust_java, int_event, ev_name_cstr, payload); + lttng_ust_tracepoint(lttng_ust_java, int_event, ev_name_cstr, payload); (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); } @@ -33,7 +33,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointIntInt(JNIEnv *env, jboolean iscopy; const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); - tracepoint(lttng_ust_java, int_int_event, ev_name_cstr, payload1, payload2); + lttng_ust_tracepoint(lttng_ust_java, int_int_event, ev_name_cstr, payload1, payload2); (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); } @@ -46,7 +46,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointLong(JNIEnv *env, jboolean iscopy; const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); - tracepoint(lttng_ust_java, long_event, ev_name_cstr, payload); + lttng_ust_tracepoint(lttng_ust_java, long_event, ev_name_cstr, payload); (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); } @@ -60,7 +60,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointLongLong(JNIEnv *en jboolean iscopy; const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); - tracepoint(lttng_ust_java, long_long_event, ev_name_cstr, payload1, payload2); + lttng_ust_tracepoint(lttng_ust_java, long_long_event, ev_name_cstr, payload1, payload2); (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); } @@ -74,7 +74,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointString(JNIEnv *env, const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); const char *payload_cstr = (*env)->GetStringUTFChars(env, payload, &iscopy); - tracepoint(lttng_ust_java, string_event, ev_name_cstr, payload_cstr); + lttng_ust_tracepoint(lttng_ust_java, string_event, ev_name_cstr, payload_cstr); (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); (*env)->ReleaseStringUTFChars(env, payload, payload_cstr); 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..48955795 100644 --- a/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c +++ b/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c @@ -268,7 +268,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 +288,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 +318,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)--; @@ -371,7 +371,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 +392,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 +414,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()); } diff --git a/src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c b/src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c index c6633fe8..9b14317b 100644 --- a/src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c +++ b/src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c @@ -43,10 +43,10 @@ int pthread_mutex_lock(pthread_mutex_t *mutex) } thread_in_trace = 1; - tracepoint(lttng_ust_pthread, pthread_mutex_lock_req, mutex, + lttng_ust_tracepoint(lttng_ust_pthread, pthread_mutex_lock_req, mutex, LTTNG_UST_CALLER_IP()); retval = mutex_lock(mutex); - tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex, + lttng_ust_tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex, retval, LTTNG_UST_CALLER_IP()); thread_in_trace = 0; return retval; @@ -73,7 +73,7 @@ int pthread_mutex_trylock(pthread_mutex_t *mutex) thread_in_trace = 1; retval = mutex_trylock(mutex); - tracepoint(lttng_ust_pthread, pthread_mutex_trylock, mutex, + lttng_ust_tracepoint(lttng_ust_pthread, pthread_mutex_trylock, mutex, retval, LTTNG_UST_CALLER_IP()); 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(lttng_ust_pthread, pthread_mutex_unlock, mutex, + lttng_ust_tracepoint(lttng_ust_pthread, pthread_mutex_unlock, mutex, retval, LTTNG_UST_CALLER_IP()); thread_in_trace = 0; return retval; diff --git a/src/lib/lttng-ust-python-agent/lttng_ust_python.c b/src/lib/lttng-ust-python-agent/lttng_ust_python.c index f2efb4ea..9782f512 100644 --- a/src/lib/lttng-ust-python-agent/lttng_ust_python.c +++ b/src/lib/lttng-ust-python-agent/lttng_ust_python.c @@ -20,6 +20,6 @@ void py_tracepoint(const char *asctime, const char *msg, const char *logger_name, const char *funcName, unsigned int lineno, unsigned int int_loglevel, unsigned int thread, const char *threadName) { - tracepoint(lttng_python, event, asctime, msg, logger_name, funcName, + lttng_ust_tracepoint(lttng_python, event, asctime, msg, logger_name, funcName, lineno, int_loglevel, thread, threadName); } diff --git a/src/lib/lttng-ust/lttng-ust-statedump.c b/src/lib/lttng-ust/lttng-ust-statedump.c index 84d7111f..1251c3bd 100644 --- a/src/lib/lttng-ust/lttng-ust-statedump.c +++ b/src/lib/lttng-ust/lttng-ust-statedump.c @@ -207,7 +207,7 @@ void trace_bin_info_cb(struct lttng_ust_session *session, void *priv) { struct bin_info_data *bin_data = (struct bin_info_data *) priv; - tracepoint(lttng_ust_statedump, bin_info, + lttng_ust_tracepoint(lttng_ust_statedump, bin_info, session, bin_data->base_addr_ptr, bin_data->resolved_path, bin_data->memsz, bin_data->is_pic, bin_data->has_build_id, @@ -219,7 +219,7 @@ void trace_build_id_cb(struct lttng_ust_session *session, void *priv) { struct bin_info_data *bin_data = (struct bin_info_data *) priv; - tracepoint(lttng_ust_statedump, build_id, + lttng_ust_tracepoint(lttng_ust_statedump, build_id, session, bin_data->base_addr_ptr, bin_data->build_id, bin_data->build_id_len); } @@ -229,7 +229,7 @@ void trace_debug_link_cb(struct lttng_ust_session *session, void *priv) { struct bin_info_data *bin_data = (struct bin_info_data *) priv; - tracepoint(lttng_ust_statedump, debug_link, + lttng_ust_tracepoint(lttng_ust_statedump, debug_link, session, bin_data->base_addr_ptr, bin_data->dbg_file, bin_data->crc); } @@ -238,19 +238,19 @@ static void procname_cb(struct lttng_ust_session *session, void *priv) { char *procname = (char *) priv; - tracepoint(lttng_ust_statedump, procname, session, procname); + lttng_ust_tracepoint(lttng_ust_statedump, procname, session, procname); } static void trace_start_cb(struct lttng_ust_session *session, void *priv __attribute__((unused))) { - tracepoint(lttng_ust_statedump, start, session); + lttng_ust_tracepoint(lttng_ust_statedump, start, session); } static void trace_end_cb(struct lttng_ust_session *session, void *priv __attribute__((unused))) { - tracepoint(lttng_ust_statedump, end, session); + lttng_ust_tracepoint(lttng_ust_statedump, end, session); } static @@ -380,19 +380,19 @@ void iter_begin(struct dl_iterate_data *data) static void trace_lib_load(const struct bin_info_data *bin_data, void *ip) { - tracepoint(lttng_ust_lib, load, + lttng_ust_tracepoint(lttng_ust_lib, load, ip, bin_data->base_addr_ptr, bin_data->resolved_path, bin_data->memsz, bin_data->has_build_id, bin_data->has_debug_link); if (bin_data->has_build_id) { - tracepoint(lttng_ust_lib, build_id, + lttng_ust_tracepoint(lttng_ust_lib, build_id, ip, bin_data->base_addr_ptr, bin_data->build_id, bin_data->build_id_len); } if (bin_data->has_debug_link) { - tracepoint(lttng_ust_lib, debug_link, + lttng_ust_tracepoint(lttng_ust_lib, debug_link, ip, bin_data->base_addr_ptr, bin_data->dbg_file, bin_data->crc); } @@ -401,7 +401,7 @@ void trace_lib_load(const struct bin_info_data *bin_data, void *ip) static void trace_lib_unload(const struct bin_info_data *bin_data, void *ip) { - tracepoint(lttng_ust_lib, unload, ip, bin_data->base_addr_ptr); + lttng_ust_tracepoint(lttng_ust_lib, unload, ip, bin_data->base_addr_ptr); } static diff --git a/tests/benchmark/bench.c b/tests/benchmark/bench.c index a5afa769..5b17af8b 100644 --- a/tests/benchmark/bench.c +++ b/tests/benchmark/bench.c @@ -48,7 +48,7 @@ void do_stuff(void) for (i = 0; i < 100; i++) cmm_barrier(); #ifdef TRACING - tracepoint(ust_tests_benchmark, tpbench, v); + lttng_ust_tracepoint(ust_tests_benchmark, tpbench, v); #endif } diff --git a/tests/compile/ctf-types/ctf-types.c b/tests/compile/ctf-types/ctf-types.c index c93c5177..6b6021db 100644 --- a/tests/compile/ctf-types/ctf-types.c +++ b/tests/compile/ctf-types/ctf-types.c @@ -23,12 +23,12 @@ int main(int argc, char **argv) fprintf(stderr, "Tracing... "); for (i = 0; i < 100; i++) { - tracepoint(ust_tests_ctf_types, tptest, i, i % 6, + lttng_ust_tracepoint(ust_tests_ctf_types, tptest, i, i % 6, i % 21); } for (i = 0; i < 10; i++) { - tracepoint(ust_tests_ctf_types, tptest_bis, i, i % 6); + lttng_ust_tracepoint(ust_tests_ctf_types, tptest_bis, i, i % 6); } fprintf(stderr, " done.\n"); return 0; diff --git a/tests/compile/hello-many/hello-many.c b/tests/compile/hello-many/hello-many.c index 24736f68..e615b33d 100644 --- a/tests/compile/hello-many/hello-many.c +++ b/tests/compile/hello-many/hello-many.c @@ -31,8 +31,8 @@ int main(int argc, char **argv) sleep(delay); fprintf(stderr, "Tracing... "); - tracepoint(ust_tests_hello_many, tptest_simple1); - tracepoint(ust_tests_hello_many, tptest_simple34); + lttng_ust_tracepoint(ust_tests_hello_many, tptest_simple1); + lttng_ust_tracepoint(ust_tests_hello_many, tptest_simple34); fprintf(stderr, " done.\n"); return 0; } diff --git a/tests/compile/hello/hello.c b/tests/compile/hello/hello.c index 87f2637b..6b36ee7c 100644 --- a/tests/compile/hello/hello.c +++ b/tests/compile/hello/hello.c @@ -30,7 +30,7 @@ static void inthandler(int sig __attribute__((unused))) { printf("in SIGUSR1 handler\n"); - tracepoint(ust_tests_hello, tptest_sighandler); + lttng_ust_tracepoint(ust_tests_hello, tptest_sighandler); } static @@ -83,7 +83,7 @@ int main(int argc, char **argv) fprintf(stderr, "Tracing... "); for (i = 0; i < 1000000; i++) { netint = htonl(i); - tracepoint(ust_tests_hello, tptest, i, netint, values, + lttng_ust_tracepoint(ust_tests_hello, tptest, i, netint, values, text, strlen(text), dbl, flt, mybool); //usleep(100000); } diff --git a/tests/compile/same_line_tracepoint/same_line_tracepoint.c b/tests/compile/same_line_tracepoint/same_line_tracepoint.c index 2f6f1eac..2a59df81 100644 --- a/tests/compile/same_line_tracepoint/same_line_tracepoint.c +++ b/tests/compile/same_line_tracepoint/same_line_tracepoint.c @@ -10,6 +10,6 @@ int main(void) { - tracepoint(ust_tests_sameline, event1); tracepoint(ust_tests_sameline, event2); + lttng_ust_tracepoint(ust_tests_sameline, event1); lttng_ust_tracepoint(ust_tests_sameline, event2); return 0; } diff --git a/tests/compile/test-app-ctx/hello.c b/tests/compile/test-app-ctx/hello.c index be63ecbc..cb0af8b5 100644 --- a/tests/compile/test-app-ctx/hello.c +++ b/tests/compile/test-app-ctx/hello.c @@ -256,7 +256,7 @@ static void inthandler(int sig __attribute__((unused))) { printf("in SIGUSR1 handler\n"); - tracepoint(ust_tests_hello, tptest_sighandler); + lttng_ust_tracepoint(ust_tests_hello, tptest_sighandler); } static @@ -314,7 +314,7 @@ int main(int argc, char **argv) fprintf(stderr, "Tracing... "); for (i = 0; i < 1000000; i++) { netint = htonl(i); - tracepoint(ust_tests_hello, tptest, i, netint, values, + lttng_ust_tracepoint(ust_tests_hello, tptest, i, netint, values, text, strlen(text), dbl, flt, mybool); test_inc_count(); //usleep(100000); -- 2.34.1