Custom upgrade: remove canary symbols for builds without LTTNG_UST_CUSTOM_UPGRADE_CON...
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Jun 2022 19:54:48 +0000 (15:54 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 30 Sep 2022 18:33:34 +0000 (14:33 -0400)
When the symbols clashing with lttng-ust 2.12 are renamed to be suffixed
with "1", it becomes possible to run lttng-ust 2.12 and 2.13 in the same
process.

Leave those sanity checks in place for builds with
LTTNG_UST_CUSTOM_UPGRADE_CONFLICTING_SYMBOLS defined.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I8664884bdc60043bf28b923786a16ee2ee3301a8

src/lib/lttng-ust-tracepoint/tracepoint.c
src/lib/lttng-ust/lttng-ust-comm.c

index 12bc561c3342693cbdafbefac0a87612b5852981..47bbb1257b7a3112a977b1aeeb5e4e681f909387 100644 (file)
@@ -21,6 +21,7 @@
 #include <urcu/compiler.h>
 #include <urcu/system.h>
 
+#include <lttng/ust-config.h>
 #include <lttng/tracepoint.h>
 #include <lttng/ust-abi.h>     /* for LTTNG_UST_ABI_SYM_NAME_LEN */
 #include <lttng/ust-common.h>
@@ -608,6 +609,7 @@ static void tracepoint_release_queue_add_old_probes(void *old)
        }
 }
 
+#ifdef LTTNG_UST_CUSTOM_UPGRADE_CONFLICTING_SYMBOLS
 /*
  * Use a symbol of the previous ABI to detect if liblttng-ust-tracepoint.so.0
  * is loaded in the current process.
@@ -640,6 +642,9 @@ int tracepoint_register_lib(void *arg0 __attribute__((unused)), int arg1 __attri
 
        return -1;
 }
+#else
+static void lttng_ust_tracepoint_check_soname_0(void) {}
+#endif
 
 /**
  * lttng_ust_tracepoint_provider_register -  Connect a probe to a tracepoint
index cf819b8027ce3d6267148c4d6978047b9aeaab15..adb159a35e11e550d8611174b9cc0a32c2d0998e 100644 (file)
@@ -2124,6 +2124,7 @@ void lttng_ust_libc_wrapper_malloc_ctor(void)
 {
 }
 
+#ifdef LTTNG_UST_CUSTOM_UPGRADE_CONFLICTING_SYMBOLS
 /*
  * Use a symbol of the previous ABI to detect if liblttng-ust.so.0 is loaded in
  * the current process.
@@ -2158,6 +2159,9 @@ void init_usterr(void)
                "The process is likely linked against different major soname of LTTng-UST which is unsupported. "
                "The detection was triggered by canary symbol \"%s\"\n", __func__);
 }
+#else
+static void lttng_ust_check_soname_0(void) {}
+#endif
 
 /*
  * sessiond monitoring thread: monitor presence of global and per-user
This page took 0.02739 seconds and 5 git commands to generate.