From 468589da1a60b5288b5ffa75b0f21a91dcb5bc8b Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 4 May 2016 16:59:41 -0400 Subject: [PATCH] Make code and man pages share the same default values Signed-off-by: Philippe Proulx Signed-off-by: Mathieu Desnoyers --- configure.ac | 9 +++++++++ doc/man/Makefile.am | 3 ++- doc/man/lttng-ust.3.txt | 2 +- include/ust-comm.h | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 5f3e9dc2..c137ff87 100644 --- a/configure.ac +++ b/configure.ac @@ -424,6 +424,15 @@ and installing the man pages. AM_CONDITIONAL([MAN_PAGES_OPT], [test "x$man_pages_opt" != "xno"]) AM_CONDITIONAL([HAVE_ASCIIDOC_XMLTO], [test "x$have_asciidoc_xmlto" = "xyes"]) +# Default values +AC_DEFUN([_AC_DEFINE_AND_SUBST], [ + AC_DEFINE_UNQUOTED([CONFIG_$1], [$2], [$1]) + $1="$2" + AC_SUBST([$1]) +]) + +_AC_DEFINE_AND_SUBST([LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS], [3000]) + AC_CONFIG_FILES([ Makefile doc/Makefile diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 20362045..22aed154 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -55,7 +55,8 @@ if MAN_PAGES_OPT if HAVE_ASCIIDOC_XMLTO # Tools to execute: ADOC = $(ASCIIDOC) -f $(ASCIIDOC_CONF) -d manpage \ - -a lttng_version="$(PACKAGE_VERSION)" + -a lttng_version="$(PACKAGE_VERSION)" \ + -a lttng_ust_register_timeout="@LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS@" ADOC_DOCBOOK = $(ADOC) -b docbook XTO = $(XMLTO) -m $(firstword $(XSL_SRC_FILES)) man diff --git a/doc/man/lttng-ust.3.txt b/doc/man/lttng-ust.3.txt index 1d69221d..ff0e14f7 100644 --- a/doc/man/lttng-ust.3.txt +++ b/doc/man/lttng-ust.3.txt @@ -1100,7 +1100,7 @@ The value 0 means _do not wait_. The value -1 means _wait forever_. Setting this environment variable to 0 is recommended for applications with time constraints on the process startup time. + -Default: 3000. +Default: {lttng_ust_register_timeout}. `LTTNG_UST_WITHOUT_BADDR_STATEDUMP`:: Prevent `liblttng-ust` from performing a base address state dump diff --git a/include/ust-comm.h b/include/ust-comm.h index 7f363d40..fb0c0bbc 100644 --- a/include/ust-comm.h +++ b/include/ust-comm.h @@ -40,7 +40,7 @@ * variable "LTTNG_UST_REGISTER_TIMEOUT". Note that if the sessiond is not * found, the application proceeds directly without any delay. */ -#define LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS 3000 +#define LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS CONFIG_LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS #define LTTNG_DEFAULT_RUNDIR LTTNG_SYSTEM_RUNDIR #define LTTNG_DEFAULT_HOME_RUNDIR ".lttng" -- 2.34.1