~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 */
#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>
/*
* 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
*/
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
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