Custom upgrade: suffix lttng_ust_loaded with 1
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Jun 2022 18:42:24 +0000 (14:42 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 30 Sep 2022 18:33:34 +0000 (14:33 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I8efb7b3e3b291b3716762a1a56c131263915ef4c

doc/man/lttng-ust.3.txt
src/lib/lttng-ust/lttng-ust-comm.c

index 0924a4de2dc7d65c411951293598ab0baafd22e6..bb52bfe9854b033738cdaf60e67e899c5a72c4dd 100644 (file)
@@ -1180,20 +1180,20 @@ Detect if LTTng-UST is loaded
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 To detect if `liblttng-ust` is loaded from an application:
 
-. Define the `lttng_ust_loaded` weak symbol globally:
+. Define the `lttng_ust_loaded1` weak symbol globally:
 +
 ------------------------------------------------------------------------
-int lttng_ust_loaded __attribute__((weak));
+int lttng_ust_loaded1 __attribute__((weak));
 ------------------------------------------------------------------------
 +
 This weak symbol is set by the constructor of `liblttng-ust`.
 
-. Test `lttng_ust_loaded` where needed:
+. Test `lttng_ust_loaded1` where needed:
 +
 ------------------------------------------------------------------------
 /* ... */
 
-if (lttng_ust_loaded) {
+if (lttng_ust_loaded1) {
     /* LTTng-UST is loaded */
 } else {
     /* LTTng-UST is NOT loaded */
index a07e1e12483bf051e68d973883fc439e9b611c44..cf819b8027ce3d6267148c4d6978047b9aeaab15 100644 (file)
@@ -28,6 +28,7 @@
 #include <urcu/compiler.h>
 #include <lttng/urcu/urcu-ust.h>
 
+#include <lttng/ust-config.h>
 #include <lttng/ust-utils.h>
 #include <lttng/ust-events.h>
 #include <lttng/ust-abi.h>
@@ -113,10 +114,10 @@ static int lttng_ust_comm_should_quit;
 /*
  * This variable can be tested by applications to check whether
  * lttng-ust is loaded. They simply have to define their own
- * "lttng_ust_loaded" weak symbol, and test it. It is set to 1 by the
+ * "lttng_ust_loaded1" weak symbol, and test it. It is set to 1 by the
  * library constructor.
  */
-int lttng_ust_loaded __attribute__((weak));
+static int lttng_ust_loaded_orig;
 
 /*
  * Notes on async-signal-safety of ust lock: a few libc functions are used
@@ -2185,7 +2186,7 @@ void lttng_ust_ctor(void)
         */
        lttng_ust_alloc_tls();
 
-       lttng_ust_loaded = 1;
+       lttng_ust_loaded_orig = 1;
 
        /*
         * Check if we find a symbol of the previous ABI in the current process
@@ -2631,3 +2632,10 @@ void lttng_ust_sockinfo_session_enabled(void *owner)
        struct sock_info *sock_info = owner;
        sock_info->statedump_pending = 1;
 }
+
+/* Custom upgrade 2.12 to 2.13 */
+extern int lttng_ust_loaded1 __attribute__((weak, alias("lttng_ust_loaded_orig")));
+
+#ifdef LTTNG_UST_CUSTOM_UPGRADE_CONFLICTING_SYMBOLS
+extern int lttng_ust_loaded __attribute__((weak, alias("lttng_ust_loaded_orig")));
+#endif
This page took 0.029287 seconds and 5 git commands to generate.