LTTng-UST support: --disable-lttng-ust build option
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Nov 2011 11:32:26 +0000 (07:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Nov 2011 11:32:26 +0000 (07:32 -0400)
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>
configure.ac
include/lttng-sessiond-comm.h
include/lttng/lttng-ustconsumer.h
liblttng-consumer/Makefile.am
liblttng-ustconsumer/Makefile.am
lttng-consumerd/Makefile.am
lttng-consumerd/lttng-consumerd.c
lttng-sessiond/Makefile.am
lttng-sessiond/trace-ust.h
lttng-sessiond/ust-app.h
lttng-sessiond/ust-ctl.h

index b4a4b9ebb9f8acffd227bb395c175d97333ab0f9..8c0eb54d345d6561281793d01f5012cc5db4243e 100644 (file)
@@ -8,8 +8,6 @@ AM_SILENT_RULES([yes])
 
 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 \
@@ -49,19 +47,25 @@ AC_CHECK_DECL([caa_likely], [],
        [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])
 
index 8843a11331b3629f87ac19bb36ba9be79ae5f930..55647faf05b58a73d7d9eca4e86696dc43f92fe2 100644 (file)
@@ -227,7 +227,7 @@ struct lttcomm_consumer_msg {
        } u;
 };
 
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
 
 #include <lttng/ust-abi.h>
 
@@ -266,7 +266,7 @@ struct lttcomm_ust_reply {
        } 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);
index efc4667c94d93dda57fb44d228c01b43d754fbaf..eacff654f65901a55408b350e75dbd383dc6e645 100644 (file)
@@ -24,7 +24,7 @@
 #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.
@@ -66,8 +66,7 @@ extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
 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(
@@ -130,6 +129,6 @@ void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
 {
 }
 
-#endif /* CONFIG_LTTNG_TOOLS_HAVE_UST */
+#endif /* HAVE_LIBLTTNG_UST_CTL */
 
 #endif /* _LTTNG_USTCONSUMER_H */
index e3aa02a223b86dec4d4c5d01d02a2ba25256e8ae..80f5843dad5f45490969bba43646f87fbd9020d8 100644 (file)
@@ -9,7 +9,7 @@ liblttng_consumer_la_LIBADD = \
                $(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
index 1816fef4e146fc8e34e6ca130ee35302369c5dd4..284eccf97c4b4626df5488fe70044ade92898642 100644 (file)
@@ -1,6 +1,6 @@
 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
index 9ce0baef611296504b48733920aa72fe0692b97b..70ebc50356e67a072bbeafcdc0e2dfd73989f273 100644 (file)
@@ -9,6 +9,6 @@ lttng_consumerd_LDADD = \
           $(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
index 946f0aba0998f23c39bfe2c053db8378eff77f6a..c85914e7f9b1c8a0db37ea88b8b6cee970010f95 100644 (file)
@@ -139,7 +139,7 @@ static void usage(void)
                        "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)"
@@ -163,7 +163,7 @@ static void parse_args(int argc, char **argv)
                { "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 }
@@ -207,7 +207,7 @@ static void parse_args(int argc, char **argv)
                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;
index 52659f4afb916b912fee6cb50f9706a907e2a3a2..26faf89cf74169dcf6ad62deb5ced33dd8676e79 100644 (file)
@@ -27,7 +27,7 @@ lttng_sessiond_SOURCES = utils.c utils.h \
                        ../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
 
@@ -40,6 +40,6 @@ lttng_sessiond_LDADD = -lrt -lurcu-cds -lurcu \
                 $(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
index aea7e714f03b27b2909c29b225012d3774e19397..35683ebce6b95970694da76d7d74de34be36a8e0 100644 (file)
@@ -110,7 +110,7 @@ struct ltt_ust_session {
        struct cds_lfht *domain_exec;
 };
 
-#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST
+#ifdef HAVE_LIBLTTNG_UST_CTL
 
 /*
  * Lookup functions. NULL is returned if not found.
@@ -139,7 +139,7 @@ void trace_ust_destroy_metadata(struct ltt_ust_metadata *metadata);
 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,
@@ -198,6 +198,6 @@ void trace_ust_destroy_event(struct ltt_ust_event *event)
 {
 }
 
-#endif /* CONFIG_CONFIG_LTTNG_TOOLS_HAVE_UST */
+#endif /* HAVE_LIBLTTNG_UST_CTL */
 
 #endif /* _LTT_TRACE_UST_H */
index 46fb65427b140b888360dff31a656a29d37c88be..04c3472dd6851e83bc9b71e3de16ead92241d3e0 100644 (file)
@@ -97,7 +97,7 @@ struct ust_app {
        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);
@@ -113,7 +113,7 @@ void ust_app_ht_alloc(void);
 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)
@@ -160,6 +160,6 @@ int ust_app_add_channel(struct ltt_ust_session *usess,
        return 0;
 }
 
-#endif /* CONFIG_LTTNG_TOOLS_HAVE_UST */
+#endif /* HAVE_LIBLTTNG_UST_CTL */
 
 #endif /* _LTT_UST_APP_H */
index e8c10a7121da6bebf5235ce284c4cdce60f8d3cc..f4f34ee2f00bc32eecc3ad434c0f9737409e7a63 100644 (file)
@@ -30,7 +30,7 @@
  * 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
This page took 0.030941 seconds and 4 git commands to generate.