Introduce API compatibility macros
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Apr 2021 13:36:07 +0000 (09:36 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Apr 2021 14:59:36 +0000 (10:59 -0400)
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 <mathieu.desnoyers@efficios.com>
Change-Id: I39e5eb4ae6ceea91dd039d52c429a791bb11ce66

23 files changed:
doc/examples/demo/demo.c
doc/examples/easy-ust/sample.c
doc/examples/gen-tp/sample.c
doc/examples/hello-static-lib/hello.c
include/Makefile.am
include/lttng/tracepoint.h
include/lttng/ust-api-compat.h [new file with mode: 0644]
src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c
src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c
src/lib/lttng-ust-dl/lttng-ust-dl.c
src/lib/lttng-ust-java-agent/jni/jul/lttng_ust_jul.c
src/lib/lttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c
src/lib/lttng-ust-java/LTTngUst.c
src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c
src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c
src/lib/lttng-ust-python-agent/lttng_ust_python.c
src/lib/lttng-ust/lttng-ust-statedump.c
tests/benchmark/bench.c
tests/compile/ctf-types/ctf-types.c
tests/compile/hello-many/hello-many.c
tests/compile/hello/hello.c
tests/compile/same_line_tracepoint/same_line_tracepoint.c
tests/compile/test-app-ctx/hello.c

index 7a16125a016dd8cbc4fd668522424154a53d4cb2..aa54055b4d2c0de3012bce43703c7706b4689c90 100644 (file)
@@ -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;
 }
index 36509ebc4c3bf3b70a3b812e058cfa8dcdd6093c..542a8f62823c5ed25b67c701f0e753c8c4f79d2d 100644 (file)
@@ -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;
index e56c332e79dfd55dc2c194e3d8c9dd7cd527658d..52c4a9ebc5df52043a67bf83edfe8780fe1b9c9f 100644 (file)
@@ -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;
index 8121d1fef8d3709b51ad3497d949ed595e28fc31..4c339715d29ba707e21dac051e6f99d28ad30d2a 100644 (file)
@@ -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");
index 72239e5a1a3c9cb82cfd682c65f3fa1a681c958e..83030c5cc3b24471ab98d2902474505f71c14f79 100644 (file)
@@ -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 \
index 98c3c8dd89bfd2b6419bca7f6e15b255967209aa..96e0160552658b3a7c26e4eb6634a77c17c588a3 100644 (file)
@@ -19,6 +19,7 @@
 #include <lttng/ust-config.h>  /* for sdt */
 #include <lttng/ust-compiler.h>
 #include <lttng/ust-tracer.h>
+#include <lttng/ust-api-compat.h>
 
 #define LTTNG_UST_TRACEPOINT_NAME_LEN_MAX      256
 
 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 (file)
index 0000000..af9c272
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2021 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * 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 */
index bee7ac04d0da2a987cc52bb4b46431fde5a0be8a..f5396b418ca1e8f535f8422dcfa61a8d18e566c0 100644 (file)
@@ -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);
 }
index e81e1154f23511597f1126f763b64a2964464d94..c7d3d5ee24835406c9084ddc11064b69e0573861 100644 (file)
@@ -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);
 }
index e07136ce9d012d1c2d1d66641fc3d830349437c9..8470dfa39cf0b5ff221d741687d8fed5aacdccc4 100644 (file)
@@ -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);
                }
index afc9f1119ba68a3c488e2a58a122178bcd65da51..c1f4db867eb055f75273d14bdd56d2d541ed51a6 100644 (file)
@@ -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;
index e88235a6f56e964091430fb7046a477f3b62f8ea..dea4bb96668b9ce78235c7f0a81b1d6acfe4d529 100644 (file)
@@ -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);
 
index f5e0c96b9c1e59e74e29a51b47577c49d0d15ed6..5985bc41b2a8bf3b937b13c5504eeb634a004fbd 100644 (file)
@@ -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);
index 0306939960ef2a0e1104b4a9a6f8ad417fafc9e7..48955795a837bce30f88478ec9f0edd14a0806eb 100644 (file)
@@ -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());
        }
index c6633fe8592384a0d2b8947270add8775c7de2bc..9b14317b679480bbc7ad5855a6b236da75495152 100644 (file)
@@ -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;
index f2efb4ea6c3d4d66de61712a67faa0317464caae..9782f512ca0e08d08ee5aab08fbc536fa7f44900 100644 (file)
@@ -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);
 }
index 84d7111f72513f6ed265f2909963169162ad563c..1251c3bd9e2aac90f39215631fa40ce61d63f040 100644 (file)
@@ -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
index a5afa76909a90e40b7f358f0584fddccd753f1c2..5b17af8be03c11787c7665e236671103e629d060 100644 (file)
@@ -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
 }
 
index c93c5177fced1e720613ff98dac581522d149a60..6b6021db0f5d8374d7277bcd9d8bfd0e225047c9 100644 (file)
@@ -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;
index 24736f6854058616efa42bcec894cb6f544a878c..e615b33da0705e6a35fa8f363cbb35a016873914 100644 (file)
@@ -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;
 }
index 87f2637b487ba39d60038e7a5484d981814f5339..6b36ee7ca713f7438391c3587601ad4458daa27b 100644 (file)
@@ -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);
        }
index 2f6f1eac18aa6b1e7bd0c8f0a63ab905a71e9cbe..2a59df814a98b59931cb92f72df122758865133e 100644 (file)
@@ -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;
 }
index be63ecbc2dcfe1ef2a3c2af53a9ecbbc8f0674dc..cb0af8b54db0c470350bf1dd853bdc7a74ca13bd 100644 (file)
@@ -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);
This page took 0.039206 seconds and 4 git commands to generate.