Tracepoint API namespacing 'TRACEPOINT_DEFINE'
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 20 Apr 2021 17:00:16 +0000 (13:00 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Apr 2021 15:01:18 +0000 (11:01 -0400)
The ABI bump gives us the opportunity to namespace all public symbols
under the 'lttng_ust_' prefix. Namespace all API symbols and macros
under 'lttng_ust_' / 'LTTNG_UST_' and add compat macros to keep
compatibility with the previous API.

Change-Id: Iffa8f15a1050e8d995bcc94c46f1cd588bb70aac
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
28 files changed:
README.md
doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp
doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp
doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp
doc/examples/demo/demo.c
doc/examples/easy-ust/sample.c
doc/examples/hello-static-lib/hello.c
include/lttng/tracepoint.h
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
src/lib/lttng-ust/tracef.c
src/lib/lttng-ust/tracelog.c
tests/benchmark/bench.c
tests/compile/ctf-types/ctf-types.c
tests/compile/hello-many/hello-many.c
tests/compile/hello.cxx/hello.cpp
tests/compile/hello/hello.c
tests/compile/same_line_tracepoint/same_line_tracepoint.c
tests/compile/test-app-ctx/hello.c
tools/lttng-gen-tp

index 39fa442887f5a8ea80c48359152a6c6c29fc7b1c..9553ef151940ad7e307cae587f459621b1fc0a17 100644 (file)
--- a/README.md
+++ b/README.md
@@ -92,11 +92,11 @@ This method links the tracepoint provider with the application,
 either directly or through a static library (`.a`):
 
   1. Into exactly one unit (C/C++ source file) of your _application_,
-     define `TRACEPOINT_DEFINE` and include the tracepoint provider
+     define `LTTNG_UST_TRACEPOINT_DEFINE` and include the tracepoint provider
      header.
   2. Include the tracepoint provider header into all C/C++ files using
      the provider and insert tracepoints using the `tracepoint()` macro.
-  3. Use `-I.` when compiling the unit defining `TRACEPOINT_DEFINE`
+  3. Use `-I.` when compiling the unit defining `LTTNG_UST_TRACEPOINT_DEFINE`
      (e.g., `tp.c`).
   4. Link the application with `-ldl` on Linux, or with `-lc` on BSD,
      and with `-llttng-ust`.
@@ -124,7 +124,7 @@ This method decouples the tracepoint provider from the application,
 making it dynamically loadable.
 
   1. Into exactly one unit of your _application_, define
-     `TRACEPOINT_DEFINE` _and_ `LTTNG_UST_TRACEPOINT_PROBE_DYNAMIC_LINKAGE`,
+     `LTTNG_UST_TRACEPOINT_DEFINE` _and_ `LTTNG_UST_TRACEPOINT_PROBE_DYNAMIC_LINKAGE`,
      then include the tracepoint provider header.
   2. Include the tracepoint provider header into all C/C++ files using
      the provider and insert tracepoints using the `tracepoint()` macro.
index 2e4284d5655d584401d70be804c8f40e1021638f..cd6bcfbe18454ea396ee14c4f6d2bec047c6901a 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2016 Sebastien Boisvert <sboisvert@gydle.com>
  */
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 
 #include "aligner-lib.h"
 #include "tracepoint-provider.h"
index 95b7b3d0fcb59516000b4e95ead4f12352dbbb8a..647308b43d9e0823189e8c8ce082228fde900583 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2016 Sebastien Boisvert <sboisvert@gydle.com>
  */
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 
 #include "tester-lib.h"
 #include "tracepoint-provider.h"
index 58044b60940aef3f30f0ad11b7fae99e49aab0ec..2f60f97a33b8be69192e142d7c0b1b74f7f49b3f 100644 (file)
@@ -5,6 +5,6 @@
  */
 
 #define TRACEPOINT_CREATE_PROBES
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 
 #include "tracepoint-provider.h"
index 96f9001b4e7335f0b141b1dac4e8f3105f4ac692..d21e2ad1e9b3ca0d22f9f375a87c9243c4084158 100644 (file)
@@ -17,7 +17,7 @@
 #include <arpa/inet.h>
 #include <stdlib.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define LTTNG_UST_TRACEPOINT_PROBE_DYNAMIC_LINKAGE
 #include "ust_tests_demo.h"
 #include "ust_tests_demo2.h"
index 542a8f62823c5ed25b67c701f0e753c8c4f79d2d..101d10d79d0b24b1075ff4b3ecbba98b0c1842b6 100644 (file)
@@ -8,10 +8,10 @@
 #include <unistd.h>
 
 /*
- * We need to define TRACEPOINT_DEFINE in one C file in the program
+ * We need to define LTTNG_UST_TRACEPOINT_DEFINE in one C file in the program
  * before including provider headers.
  */
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "sample_component_provider.h"
 
 int main(void)
index 4c339715d29ba707e21dac051e6f99d28ad30d2a..0bf41f7f9367ccdcb2024ef1ec16e14428fec6e5 100644 (file)
@@ -17,7 +17,7 @@
 #include <arpa/inet.h>
 #include <stdlib.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_tests_hello.h"
 
 static
index b02ec3301893d563b0ca17bf1ddf4279a623ddae..043426fce78e580806e5446e12fa4945e7b652a0 100644 (file)
@@ -433,7 +433,13 @@ lttng_ust__tracepoints__destroy(void)
        memset(lttng_ust_tracepoint_dlopen_ptr, 0, sizeof(*lttng_ust_tracepoint_dlopen_ptr));
 }
 
-#ifdef TRACEPOINT_DEFINE
+#if LTTNG_UST_COMPAT_API(0)
+# if defined(TRACEPOINT_DEFINE) && !defined(LTTNG_UST_TRACEPOINT_DEFINE)
+#  define LTTNG_UST_TRACEPOINT_DEFINE
+# endif
+#endif /* #if LTTNG_UST_COMPAT_API(0) */
+
+#ifdef LTTNG_UST_TRACEPOINT_DEFINE
 
 /*
  * These weak symbols, the constructor, and destructor take care of
@@ -569,11 +575,11 @@ lttng_ust__tracepoints__ptrs_destroy(void)
        }
 }
 
-#else /* TRACEPOINT_DEFINE */
+#else /* LTTNG_UST_TRACEPOINT_DEFINE */
 
 #define LTTNG_UST__DEFINE_TRACEPOINT(_provider, _name, _args)
 
-#endif /* #else TRACEPOINT_DEFINE */
+#endif /* #else LTTNG_UST_TRACEPOINT_DEFINE */
 
 #if LTTNG_UST_COMPAT_API(0)
 #define tracepoint                     lttng_ust_tracepoint
index f5396b418ca1e8f535f8422dcfa61a8d18e566c0..3ea273acb11a2ac51fd7e6ad74279ea14cd93e98 100644 (file)
@@ -9,7 +9,7 @@
 #include <sys/types.h>
 #include <stdio.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #define TP_IP_PARAM func_addr
 #include "lttng-ust-cyg-profile-fast.h"
index c7d3d5ee24835406c9084ddc11064b69e0573861..8566695cd8bccd72698d0b192a1fbddb33207603 100644 (file)
@@ -9,7 +9,7 @@
 #include <sys/types.h>
 #include <stdio.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #define TP_IP_PARAM func_addr
 #include "lttng-ust-cyg-profile.h"
index 0f01b356a980b1a36cef78d986591987198c4362..e342fb2d0ed8b85971e13e51f0da19068d66d5eb 100644 (file)
@@ -26,7 +26,7 @@
 /* Include link.h last else it conflicts with ust-dlfcn. */
 #include <link.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_dl.h"
 
 static void *(*__lttng_ust_plibc_dlopen)(const char *filename, int flags);
index c1f4db867eb055f75273d14bdd56d2d541ed51a6..840b27de91c7f3a0d594ca3d3cf88d77de2288ce 100644 (file)
@@ -9,7 +9,7 @@
 #define _LGPL_SOURCE
 #include "org_lttng_ust_agent_jul_LttngJulApi.h"
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #include "lttng_ust_jul.h"
 #include "../common/lttng_ust_context.h"
index dea4bb96668b9ce78235c7f0a81b1d6acfe4d529..6708fb4cebfa54e6de0a2b6b3dcbb0e312229456 100644 (file)
@@ -9,7 +9,7 @@
 #define _LGPL_SOURCE
 #include "org_lttng_ust_agent_log4j_LttngLog4jApi.h"
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #include "lttng_ust_log4j.h"
 #include "../common/lttng_ust_context.h"
index 5985bc41b2a8bf3b937b13c5504eeb634a004fbd..69e00f90917ae98775dfe503963d7244354db6a8 100644 (file)
@@ -7,7 +7,7 @@
 #define _LGPL_SOURCE
 #include "org_lttng_ust_LTTngUst.h"
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #include "lttng_ust_java.h"
 
index 48955795a837bce30f88478ec9f0edd14a0806eb..3243693d84ca65c2ef4180401a420aad47a8a2a4 100644 (file)
@@ -30,7 +30,7 @@
 #include "common/macros.h"
 #include "common/align.h"
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #define TP_IP_PARAM ip
 #include "ust_libc.h"
index 9b14317b679480bbc7ad5855a6b236da75495152..b590aa3e3082718c5fae10b46b82744303928582 100644 (file)
@@ -16,7 +16,7 @@
 #include "common/macros.h"
 #include <pthread.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #define TP_IP_PARAM ip
 #include "ust_pthread.h"
index 9782f512ca0e08d08ee5aab08fbc536fa7f44900..44b6ccf91c8d61c14e9eb0a3d2bee2a9a58185b9 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #define _LGPL_SOURCE
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #include "lttng_ust_python.h"
 
index 31626f8c5fc4d614f7255f6f47b6159844e964b7..b0c9a1a8bc0511bd83456a8820eaa1a38de26db8 100644 (file)
@@ -24,7 +24,7 @@
 #include "common/getenv.h"
 #include "lib/lttng-ust/events.h"
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_lib.h"                           /* Only define. */
 
 #define TRACEPOINT_CREATE_PROBES
index e48ef802c1cdbddc41aa9e49435e9e1b2d7f64fe..b3aa32e97911c0138fa7517a195f1615463854b6 100644 (file)
@@ -9,7 +9,7 @@
 #include "common/macros.h"
 
 #define TRACEPOINT_CREATE_PROBES
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "lttng-ust-tracef-provider.h"
 
 static inline
index 28a3e1acd86cb1d219a9efdca2c64ce5caed5e48..f506e8aef080fb884315fa8ae1ea8f76ad4757d7 100644 (file)
@@ -9,7 +9,7 @@
 #include "common/macros.h"
 
 #define TRACEPOINT_CREATE_PROBES
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "lttng-ust-tracelog-provider.h"
 
 #define TRACELOG_CB(level) \
index 5b17af8be03c11787c7665e236671103e629d060..fcd373ad973ac1edc3d8a8806b6a762a43f2442c 100644 (file)
@@ -16,7 +16,7 @@
 #include <urcu/compiler.h>
 
 #ifdef TRACING
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_tests_benchmark.h"
 #endif
 
index 6b6021db0f5d8374d7277bcd9d8bfd0e225047c9..c54ed6a4b6bb795845449612d852be5433116b91 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <unistd.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_tests_ctf_types.h"
 
 int main(int argc, char **argv)
index e615b33da0705e6a35fa8f363cbb35a016873914..1cae515ff36421935129b2f0840525a26e257951 100644 (file)
@@ -16,7 +16,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_tests_hello_many.h"
 
 int main(int argc, char **argv)
index afbcf4694783aaa6f19567bd6854b383b80b2d92..e031279bec0ae3ac2f52364c1f28b9ce3a64938c 100644 (file)
@@ -17,7 +17,7 @@
 #include <arpa/inet.h>
 #include <stdlib.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_tests_hello.h"
 
 static
index 6b36ee7ca713f7438391c3587601ad4458daa27b..107cf55e1051cb7f036f005939a6c07d59272318 100644 (file)
@@ -23,7 +23,7 @@ struct mmsghdr;
 #include <stdlib.h>
 #include <stdbool.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_tests_hello.h"
 
 static
index 2a59df814a98b59931cb92f72df122758865133e..9ec026073572c23c7180c8530f1ea0c10bd8ede9 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2013 Jérémie Galarneau
  */
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
 #include "ust_tests_sameline.h"
 
index cb0af8b54db0c470350bf1dd853bdc7a74ca13bd..723f179f4809c9e8d13d8f1718eb1650ee4583ae 100644 (file)
@@ -25,7 +25,7 @@ struct mmsghdr;
 #include <stdlib.h>
 #include <stdbool.h>
 
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "ust_tests_hello.h"
 
 #include <lttng/ust-events.h>
index 919f01a31d964b5fe150e7883ab4e9f43de045d3..b318d1cdcf8c592e8db6ff399b7d0125cd929ead 100755 (executable)
@@ -61,7 +61,7 @@ class CFile:
 /*
  * The header containing our LTTNG_UST_TRACEPOINT_EVENTs.
  */
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "{headerFilename}"
 """
 
This page took 0.0405 seconds and 4 git commands to generate.