+int ust_consumerd64_fd = -1;
+int ust_consumerd32_fd = -1;
+
+static const char *consumerd32_bin =
+ __stringify(CONFIG_CONSUMERD32_BIN);
+static const char *consumerd64_bin =
+ __stringify(CONFIG_CONSUMERD64_BIN);
+static const char *consumerd32_libdir =
+ __stringify(CONFIG_CONSUMERD32_LIBDIR);
+static const char *consumerd64_libdir =
+ __stringify(CONFIG_CONSUMERD64_LIBDIR);
+
+static
+void setup_consumerd_path(void)
+{
+ const char *bin, *libdir;
+
+ /*
+ * Allow INSTALL_BIN_PATH to be used as a target path for the
+ * native architecture size consumer if CONFIG_CONSUMER*_PATH
+ * has not been defined.
+ */
+#if (CAA_BITS_PER_LONG == 32)
+ if (!consumerd32_bin[0]) {
+ consumerd32_bin = INSTALL_BIN_PATH "/" CONSUMERD_FILE;
+ }
+ if (!consumerd32_libdir[0]) {
+ consumerd32_libdir = INSTALL_LIB_PATH;
+ }
+#elif (CAA_BITS_PER_LONG == 64)
+ if (!consumerd64_bin[0]) {
+ consumerd64_bin = INSTALL_BIN_PATH "/" CONSUMERD_FILE;
+ }
+ if (!consumerd64_libdir[0]) {
+ consumerd64_libdir = INSTALL_LIB_PATH;
+ }
+#else
+#error "Unknown bitness"
+#endif
+
+ /*
+ * runtime env. var. overrides the build default.
+ */
+ bin = getenv("LTTNG_CONSUMERD32_BIN");
+ if (bin) {
+ consumerd32_bin = bin;
+ }
+ bin = getenv("LTTNG_CONSUMERD64_BIN");
+ if (bin) {
+ consumerd64_bin = bin;
+ }
+ libdir = getenv("LTTNG_TOOLS_CONSUMERD32_LIBDIR");
+ if (libdir) {
+ consumerd32_libdir = libdir;
+ }
+ libdir = getenv("LTTNG_TOOLS_CONSUMERD64_LIBDIR");
+ if (libdir) {
+ consumerd64_libdir = libdir;
+ }
+}
+