From now on, configure fails if lttng-ust is not found.
--disable-lttng-ust must be explicitely specified to build without UST
support.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
AC_CONFIG_HEADERS([include/config.h])
-AH_TEMPLATE([CONFIG_LTTNG_TOOLS_HAVE_UST], [Defined on systems where UST headers can be found.])
-
AC_CHECK_HEADERS([ \
sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \
signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
[AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
)
-# Check libust library
-AC_CHECK_DECL([ustctl_create_session],
- [
- AC_DEFINE([CONFIG_LTTNG_TOOLS_HAVE_UST], 1)
- have_ust_test=1
- ],
- [
- AC_MSG_WARN([UST header not found. Building without UST support.])
- have_ust_test=0
- ],
- [[#include <lttng/ust-ctl.h>]]
-)
-AM_CONDITIONAL([LTTNG_TOOLS_HAVE_UST], [ test "x$have_ust_test" = "x1" ])
+# Check liblttng-ust-ctl library
+AC_ARG_ENABLE(lttng-ust,
+ [ --disable-lttng-ust build without LTTng-UST (Userspace Tracing) support.],
+ lttng_ust_support=no, lttng_ust_support=yes)
+
+[
+if test "x$lttng_ust_support" = "xno"; then
+ echo "LTTng-UST support disabled."
+else
+]
+ AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
+ [AC_MSG_ERROR([Cannot find LTTng-UST. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])]
+ )
+[
+ echo "LTTng-UST support enabled."
+fi
+]
+
+AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
AC_CHECK_FUNCS([sched_getcpu sysconf])
} u;
};
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
#include <lttng/ust-abi.h>
} u;
};
-#endif /* CONFIG_LTTNG_TOOLS_HAVE_UST */
+#endif /* HAVE_LIBLTTNG_UST_CTL */
extern int lttcomm_create_unix_sock(const char *pathname);
extern int lttcomm_connect_unix_sock(const char *pathname);
#include <lttng/lttng-consumer.h>
#include <errno.h>
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
/*
* Mmap the ring buffer, read it and write the data to the tracefile.
extern int lttng_ustconsumer_allocate_stream(struct lttng_consumer_stream *stream);
extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
-
-#else /* CONFIG_LTTNG_TOOLS_HAVE_UST */
+#else /* HAVE_LIBLTTNG_UST_CTL */
static inline
int lttng_ustconsumer_on_read_subbuffer_mmap(
{
}
-#endif /* CONFIG_LTTNG_TOOLS_HAVE_UST */
+#endif /* HAVE_LIBLTTNG_UST_CTL */
#endif /* _LTTNG_USTCONSUMER_H */
$(top_builddir)/liblttng-kconsumer/liblttng-kconsumer.la
-if LTTNG_TOOLS_HAVE_UST
+if HAVE_LIBLTTNG_UST_CTL
liblttng_consumer_la_LIBADD += \
$(top_builddir)/liblttng-ustconsumer/liblttng-ustconsumer.la
endif
AM_CPPFLAGS = -I$(top_srcdir)/include
-if LTTNG_TOOLS_HAVE_UST
+if HAVE_LIBLTTNG_UST_CTL
noinst_LTLIBRARIES = liblttng-ustconsumer.la
liblttng_ustconsumer_la_SOURCES = lttng-ustconsumer.c
$(top_builddir)/liblttng-consumer/liblttng-consumer.la \
$(top_builddir)/liblttng-sessiond-comm/liblttng-sessiond-comm.la
-if LTTNG_TOOLS_HAVE_UST
+if HAVE_LIBLTTNG_UST_CTL
lttng_consumerd_LDADD += -llttng-ust-ctl
endif
"Consumer kernel buffers (default).\n");
fprintf(stderr, " -u, --ust "
"Consumer UST buffers.%s\n",
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
""
#else
" (support not compiled in)"
{ "verbose", 0, 0, 'v' },
{ "version", 0, 0, 'V' },
{ "kernel", 0, 0, 'k' },
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
{ "ust", 0, 0, 'u' },
#endif
{ NULL, 0, 0, 0 }
case 'k':
opt_type = LTTNG_CONSUMER_KERNEL;
break;
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
case 'u':
opt_type = LTTNG_CONSUMER_UST;
break;
../hashtable/rculfhash.h \
../hashtable/hash.c ../hashtable/hash.h
-if LTTNG_TOOLS_HAVE_UST
+if HAVE_LIBLTTNG_UST_CTL
lttng_sessiond_SOURCES += trace-ust.c ust-app.c ust-consumer.c ust-consumer.h
endif
$(top_builddir)/libkernelctl/libkernelctl.la \
$(top_builddir)/liblttngctl/liblttngctl.la
-if LTTNG_TOOLS_HAVE_UST
+if HAVE_LIBLTTNG_UST_CTL
lttng_sessiond_LDADD += -llttng-ust-comm -llttng-ust-ctl
endif
struct cds_lfht *domain_exec;
};
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
/*
* Lookup functions. NULL is returned if not found.
void trace_ust_destroy_channel(struct ltt_ust_channel *channel);
void trace_ust_destroy_event(struct ltt_ust_event *event);
-#else
+#else /* HAVE_LIBLTTNG_UST_CTL */
static inline
struct ltt_ust_event *trace_ust_find_event_by_name(struct cds_lfht *ht,
{
}
-#endif /* CONFIG_CONFIG_LTTNG_TOOLS_HAVE_UST */
+#endif /* HAVE_LIBLTTNG_UST_CTL */
#endif /* _LTT_TRACE_UST_H */
struct ust_app_key key;
};
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
int ust_app_register(struct ust_register_msg *msg, int sock);
void ust_app_unregister(int sock);
struct cds_lfht *ust_app_get_ht(void);
struct ust_app *ust_app_find_by_pid(pid_t pid);
-#else
+#else /* HAVE_LIBLTTNG_UST_CTL */
static inline
int ust_app_register(struct ust_register_msg *msg, int sock)
return 0;
}
-#endif /* CONFIG_LTTNG_TOOLS_HAVE_UST */
+#endif /* HAVE_LIBLTTNG_UST_CTL */
#endif /* _LTT_UST_APP_H */
* own internal structures within lttng-tools instead of relying on the
* UST ABI.
*/
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
#include <lttng/ust-ctl.h>
#include <lttng/ust-abi.h>
#else