[sheepdog] [PATCH 1/6] configure: enable LTTng with --enable-lttng-ust option
Hitoshi Mitake
mitake.hitoshi at lab.ntt.co.jp
Fri Jan 9 08:37:14 CET 2015
LTTng is a tool for low overhead tracing of events. It is already
employed by QEMU and friendly with tracing mechanism of linux kernel,
so it is very useful for performance analysis and debugging of
sheepdog.
Below is a brief example of lttng tracing:
$ lttng create sheepdog
Session sheepdog created.
Traces will be written in /home/mitake/lttng-traces/sheepdog-20150109-161938
$ lttng enable-event -a -u -c sheepdog
All UST events are enabled in channel sheepdog
$ lttng start
Tracing started for session sheepdog
# do something you want to analyze
$ lttng stop
Then, you can view or analyze collected events in your favorite way.
Example of babeltrace (just viewing):
$ babeltrace lttng-traces/sheepdog-20150109-161938
This patch is just a preparation. It adds a new option
--enable-lttng-ust for activating LTTng ready binaries of sheepdog.
Cc: Gu Ping <guping610 at qq.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
configure.ac | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index e3d41d8..9f2e7f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,6 +270,11 @@ AC_ARG_ENABLE([earthquake],
[ enable_earthquake="no" ],)
AM_CONDITIONAL(BUILD_EARTHQUAKE, test x$enable_earthquake = xyes)
+AC_ARG_ENABLE([lttng-ust],
+ [ --enable-lttng-ust : enable tracing feature based on LTTng UST (default no) ],,
+ [ enable_lttng_ust="no" ],)
+AM_CONDITIONAL(BUILD_LTTNG_UST, test x$enable_lttng_ust = xyes)
+
AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[enable systemd support]),enable_systemd=$enableval,enable_systemd="no")
dnl systemd detection
@@ -429,6 +434,13 @@ if test "x${enable_earthquake}" = xyes; then
AC_DEFINE_UNQUOTED(HAVE_EARTHQUAKE, 1, [have earthquake])
fi
+if test "x${enable_lttng_ust}" = xyes; then
+ AC_CHECK_HEADERS([lttng/tracepoint.h lttng/tracepoint-event.h],,
+ AC_MSG_ERROR(headers of LTTng not found))
+ AC_DEFINE_UNQUOTED(HAVE_LTTNG_UST, 1, [have LTTng ust])
+ PACKAGE_FEATURES="$PACKAGE_FEATURES LTTng-ust"
+fi
+
# extra warnings
EXTRA_WARNINGS=""
@@ -502,10 +514,18 @@ else
TRACE_CFLAGS=""
fi
+if test "x${enable_lttng_ust}" = xyes ; then
+ AC_MSG_NOTICE([Enabling LTTng ust (-llttng-ust -lurcu-bp)])
+ LIBS+="-llttng-ust -lurcu-bp -ldl"
+ LTTNG_UST_CFLAGS="-DENABLE_LTTNG_UST"
+else
+ LTTNG_UST_CFLAGS=""
+fi
+
# final build of *FLAGS
CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS $OS_CFLAGS \
$TRACE_CFLAGS $COVERAGE_CFLAGS $EXTRA_WARNINGS $WERROR_CFLAGS \
- -D_GNU_SOURCE -D_LGPL_SOURCE -std=gnu99"
+ $LTTNG_UST_CFLAGS -D_GNU_SOURCE -D_LGPL_SOURCE -std=gnu99"
CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS $OS_CPPFLAGS"
LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS $OS_LDFLAGS"
--
1.9.1
More information about the sheepdog
mailing list