AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.])
AC_DEFINE_UNQUOTED([CONFIG_LTTNG_SYSTEM_RUNDIR], ["$LTTNG_SYSTEM_RUNDIR"], [LTTng system runtime directory])
+AC_DEFUN([_AC_DEFINE_AND_SUBST], [
+ AC_DEFINE_UNQUOTED([CONFIG_$1], [$2], [$1])
+ $1="$2"
+ AC_SUBST([$1])
+])
+
+AC_DEFUN([_AC_DEFINE_QUOTED_AND_SUBST], [
+ AC_DEFINE_UNQUOTED([CONFIG_$1], ["$2"], [$1])
+ $1="$2"
+ AC_SUBST([$1])
+])
+
+# Default values
+m4_define([_DEFAULT_CHANNEL_SUBBUF_SIZE], [4096])
+m4_define([_DEFAULT_CHANNEL_SUBBUF_NUM], [4])
+m4_define([_DEFAULT_CHANNEL_SWITCH_TIMER], [0])
+m4_define([_DEFAULT_CHANNEL_LIVE_TIMER], [0])
+m4_define([_DEFAULT_CHANNEL_READ_TIMER], [200000])
+_AC_DEFINE_AND_SUBST([DEFAULT_AGENT_TCP_PORT], [5345])
+_AC_DEFINE_AND_SUBST([DEFAULT_APP_SOCKET_RW_TIMEOUT], [5])
+_AC_DEFINE_AND_SUBST([DEFAULT_CHANNEL_SUBBUF_SIZE], [_DEFAULT_CHANNEL_SUBBUF_SIZE])
+_AC_DEFINE_AND_SUBST([DEFAULT_CHANNEL_TRACEFILE_COUNT], [0])
+_AC_DEFINE_AND_SUBST([DEFAULT_CHANNEL_TRACEFILE_SIZE], [0])
+_AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_LIVE_TIMER], [_DEFAULT_CHANNEL_LIVE_TIMER])
+_AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_READ_TIMER], [_DEFAULT_CHANNEL_READ_TIMER])
+_AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM], [_DEFAULT_CHANNEL_SUBBUF_NUM])
+_AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE], [262144])
+_AC_DEFINE_AND_SUBST([DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER], [_DEFAULT_CHANNEL_SWITCH_TIMER])
+_AC_DEFINE_AND_SUBST([DEFAULT_LTTNG_LIVE_TIMER], [1000000])
+_AC_DEFINE_AND_SUBST([DEFAULT_METADATA_CACHE_SIZE], [4096])
+_AC_DEFINE_AND_SUBST([DEFAULT_METADATA_READ_TIMER], [0])
+_AC_DEFINE_AND_SUBST([DEFAULT_METADATA_SUBBUF_NUM], [2])
+_AC_DEFINE_AND_SUBST([DEFAULT_METADATA_SUBBUF_SIZE], [4096])
+_AC_DEFINE_AND_SUBST([DEFAULT_METADATA_SWITCH_TIMER], [_DEFAULT_CHANNEL_SWITCH_TIMER])
+_AC_DEFINE_AND_SUBST([DEFAULT_NETWORK_CONTROL_PORT], [5342])
+_AC_DEFINE_AND_SUBST([DEFAULT_NETWORK_DATA_PORT], [5343])
+_AC_DEFINE_AND_SUBST([DEFAULT_NETWORK_VIEWER_PORT], [5344])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_LIVE_TIMER], [_DEFAULT_CHANNEL_LIVE_TIMER])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_READ_TIMER], [0])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM], [_DEFAULT_CHANNEL_SUBBUF_NUM])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE], [_DEFAULT_CHANNEL_SUBBUF_SIZE])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER], [_DEFAULT_CHANNEL_SWITCH_TIMER])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_LIVE_TIMER], [_DEFAULT_CHANNEL_LIVE_TIMER])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_READ_TIMER], [0])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM], [_DEFAULT_CHANNEL_SUBBUF_NUM])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE], [131072])
+_AC_DEFINE_AND_SUBST([DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER], [_DEFAULT_CHANNEL_SWITCH_TIMER])
+_AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_AGENT_BIND_ADDRESS], [localhost])
+_AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_CONTROL_BIND_ADDRESS], [0.0.0.0])
+_AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_DATA_BIND_ADDRESS], [0.0.0.0])
+_AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_VIEWER_BIND_ADDRESS], [localhost])
+
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
#define DEFAULT_PYTHON_EVENT_NAME DEFAULT_PYTHON_EVENT_COMPONENT ":*"
#define DEFAULT_CHANNEL_OVERWRITE 0
-#define DEFAULT_CHANNEL_TRACEFILE_SIZE 0
-#define DEFAULT_CHANNEL_TRACEFILE_COUNT 0
-
-/* Must always be a power of 2 */
-#define _DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */
-/* Must always be a power of 2 */
-#define _DEFAULT_CHANNEL_SUBBUF_NUM 4
-#define _DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */
-#define _DEFAULT_CHANNEL_LIVE_TIMER 0 /* usec */
-#define _DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */
+#define DEFAULT_CHANNEL_TRACEFILE_SIZE CONFIG_DEFAULT_CHANNEL_TRACEFILE_SIZE
+#define DEFAULT_CHANNEL_TRACEFILE_COUNT CONFIG_DEFAULT_CHANNEL_TRACEFILE_COUNT
+
+#define _DEFAULT_CHANNEL_SUBBUF_SIZE CONFIG_DEFAULT_CHANNEL_SUBBUF_SIZE
#define _DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP
/* Metadata channel defaults. */
-#define DEFAULT_METADATA_SUBBUF_SIZE 4096
-#define DEFAULT_METADATA_SUBBUF_NUM 2
-#define DEFAULT_METADATA_CACHE_SIZE 4096
-#define DEFAULT_METADATA_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER
-#define DEFAULT_METADATA_READ_TIMER 0
+#define DEFAULT_METADATA_SUBBUF_SIZE CONFIG_DEFAULT_METADATA_SUBBUF_SIZE
+#define DEFAULT_METADATA_SUBBUF_NUM CONFIG_DEFAULT_METADATA_SUBBUF_NUM
+#define DEFAULT_METADATA_CACHE_SIZE CONFIG_DEFAULT_METADATA_CACHE_SIZE
+#define DEFAULT_METADATA_SWITCH_TIMER CONFIG_DEFAULT_METADATA_SWITCH_TIMER
+#define DEFAULT_METADATA_READ_TIMER CONFIG_DEFAULT_METADATA_READ_TIMER
#define DEFAULT_METADATA_OUTPUT _DEFAULT_CHANNEL_OUTPUT
/* Kernel has different defaults */
/* DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE must always be a power of 2 */
-#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */
+#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE CONFIG_DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE
/*
* DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM must always be a power of 2.
* Update help manually if override.
*/
-#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM
+#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM CONFIG_DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM
/* See lttng-kernel.h enum lttng_kernel_output for channel output */
#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE
-#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER
-#define DEFAULT_KERNEL_CHANNEL_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER
-#define DEFAULT_KERNEL_CHANNEL_LIVE_TIMER _DEFAULT_CHANNEL_LIVE_TIMER
+#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER CONFIG_DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER
+#define DEFAULT_KERNEL_CHANNEL_READ_TIMER CONFIG_DEFAULT_KERNEL_CHANNEL_READ_TIMER
+#define DEFAULT_KERNEL_CHANNEL_LIVE_TIMER CONFIG_DEFAULT_KERNEL_CHANNEL_LIVE_TIMER
/* User space defaults */
/* Must be a power of 2 */
-#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE _DEFAULT_CHANNEL_SUBBUF_SIZE
-#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE CONFIG_DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE CONFIG_DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE
/* Must be a power of 2. Update help manuall if override. */
-#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM
-#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM CONFIG_DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM CONFIG_DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM
/* See lttng-ust.h enum lttng_ust_output */
#define DEFAULT_UST_PID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT
#define DEFAULT_UST_UID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT
/* Timers in usec. */
-#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER
-#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER
-#define DEFAULT_UST_PID_CHANNEL_LIVE_TIMER _DEFAULT_CHANNEL_LIVE_TIMER
-#define DEFAULT_UST_UID_CHANNEL_LIVE_TIMER _DEFAULT_CHANNEL_LIVE_TIMER
+#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER CONFIG_DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER
+#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER CONFIG_DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER
+#define DEFAULT_UST_PID_CHANNEL_LIVE_TIMER CONFIG_DEFAULT_UST_PID_CHANNEL_LIVE_TIMER
+#define DEFAULT_UST_UID_CHANNEL_LIVE_TIMER CONFIG_DEFAULT_UST_UID_CHANNEL_LIVE_TIMER
-#define DEFAULT_UST_PID_CHANNEL_READ_TIMER 0 /* usec */
-#define DEFAULT_UST_UID_CHANNEL_READ_TIMER 0 /* usec */
+#define DEFAULT_UST_PID_CHANNEL_READ_TIMER CONFIG_DEFAULT_UST_PID_CHANNEL_READ_TIMER
+#define DEFAULT_UST_UID_CHANNEL_READ_TIMER CONFIG_DEFAULT_UST_UID_CHANNEL_READ_TIMER
/*
* Default timeout value for the sem_timedwait() call. Blocking forever is not
#define DEFAULT_SEM_WAIT_TIMEOUT 30 /* in seconds */
/* Default bind addresses for network services. */
-#define DEFAULT_NETWORK_CONTROL_BIND_ADDRESS "0.0.0.0"
-#define DEFAULT_NETWORK_DATA_BIND_ADDRESS "0.0.0.0"
-#define DEFAULT_NETWORK_VIEWER_BIND_ADDRESS "localhost"
-#define DEFAULT_AGENT_BIND_ADDRESS "localhost"
+#define DEFAULT_NETWORK_CONTROL_BIND_ADDRESS CONFIG_DEFAULT_NETWORK_CONTROL_BIND_ADDRESS
+#define DEFAULT_NETWORK_DATA_BIND_ADDRESS CONFIG_DEFAULT_NETWORK_DATA_BIND_ADDRESS
+#define DEFAULT_NETWORK_VIEWER_BIND_ADDRESS CONFIG_DEFAULT_NETWORK_VIEWER_BIND_ADDRESS
+#define DEFAULT_AGENT_BIND_ADDRESS CONFIG_DEFAULT_AGENT_BIND_ADDRESS
/* Default network ports for trace streaming support. */
-#define DEFAULT_NETWORK_CONTROL_PORT 5342
-#define DEFAULT_NETWORK_DATA_PORT 5343
-#define DEFAULT_NETWORK_VIEWER_PORT 5344
+#define DEFAULT_NETWORK_CONTROL_PORT CONFIG_DEFAULT_NETWORK_CONTROL_PORT
+#define DEFAULT_NETWORK_DATA_PORT CONFIG_DEFAULT_NETWORK_DATA_PORT
+#define DEFAULT_NETWORK_VIEWER_PORT CONFIG_DEFAULT_NETWORK_VIEWER_PORT
/* Agent registration TCP port. */
-#define DEFAULT_AGENT_TCP_PORT 5345
+#define DEFAULT_AGENT_TCP_PORT CONFIG_DEFAULT_AGENT_TCP_PORT
/*
* If a thread stalls for this amount of time, it will be considered bogus (bad
/*
* Default receiving and sending timeout for an application socket.
*/
-#define DEFAULT_APP_SOCKET_RW_TIMEOUT 5 /* sec */
+#define DEFAULT_APP_SOCKET_RW_TIMEOUT CONFIG_DEFAULT_APP_SOCKET_RW_TIMEOUT
#define DEFAULT_APP_SOCKET_TIMEOUT_ENV "LTTNG_APP_SOCKET_TIMEOUT"
#define DEFAULT_UST_STREAM_FD_NUM 2 /* Number of fd per UST stream. */
#define DEFAULT_INDEX_DIR "index"
/* Default lttng command live timer value in usec. */
-#define DEFAULT_LTTNG_LIVE_TIMER 1000000
+#define DEFAULT_LTTNG_LIVE_TIMER CONFIG_DEFAULT_LTTNG_LIVE_TIMER
/* Default runas worker name */
#define DEFAULT_RUN_AS_WORKER_NAME "lttng-runas"