[lttng-dev] [PATCH lttng-tools 08/14] Added configure option for specifying lttng run directory [LTTNG_RUNDIR] Set different default run directory for Android

Charles Briere charlesbriere.flatzo at gmail.com
Mon May 6 14:18:45 EDT 2013


Signed-off-by: Charles Briere <charlesbriere.flatzo at gmail.com>
---
 configure.ac          | 23 +++++++++++++++++++++--
 src/common/defaults.h |  2 --
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index eb79fc4..b3738d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,8 +43,10 @@ AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
 
 AM_CONDITIONAL([TARGET_HOST_ANDROID], [false])
 case "${host}" in
-    *-*-linux-androideabi) AM_CONDITIONAL([TARGET_HOST_ANDROID], [true])
-    ;;
+	*-*-linux-androideabi)
+		AM_CONDITIONAL([TARGET_HOST_ANDROID], [true])
+		target_host_android="yes"
+	;;
 esac
 
 AC_CHECK_HEADERS([ \
@@ -256,6 +258,23 @@ AC_CHECK_LIB([c], [open_memstream],
 ]
 )
 
+AC_ARG_VAR([LTTNG_RUNDIR], [Path to run directory, default to /var/run])
+
+AS_IF([test -n "$LTTNG_RUNDIR"],
+[
+	lttng_rundir=$LTTNG_RUNDIR
+],
+[
+	AS_IF([test "x$target_host_android" = "xyes"],
+	[
+		lttng_rundir="/data/lttng/var/run"
+	],
+	[
+		lttng_rundir="/var/run/lttng"
+	])
+])
+AC_DEFINE_UNQUOTED([DEFAULT_LTTNG_RUNDIR], ["$lttng_rundir"], [Location of the run directory])
+
 # For Python
 # SWIG version needed or newer:
 swig_version=2.0.0
diff --git a/src/common/defaults.h b/src/common/defaults.h
index fb6a975..74400d7 100644
--- a/src/common/defaults.h
+++ b/src/common/defaults.h
@@ -76,8 +76,6 @@
 #define DEFAULT_USTCONSUMERD32_CMD_SOCK_PATH    DEFAULT_USTCONSUMERD32_PATH "/command"
 #define DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH    DEFAULT_USTCONSUMERD32_PATH "/error"
 
-/* Default lttng run directory */
-#define DEFAULT_LTTNG_RUNDIR                    "/var/run/lttng"
 #define DEFAULT_LTTNG_HOME_RUNDIR               "%s/.lttng"
 #define DEFAULT_LTTNG_SESSIOND_PIDFILE          "lttng-sessiond.pid"
 
-- 
1.8.1.msysgit.1




More information about the lttng-dev mailing list