From b049cc3ace18dd42493ca768cf4636dfd89569fc Mon Sep 17 00:00:00 2001 From: David Goulet Date: Wed, 11 Mar 2020 12:12:28 -0400 Subject: trace: Emit a warning if tracing is built in Built in tracing should _not_ be run if it was not set on purpose. Warn as loud as we can in order to inform the user that they are running a version with tracing capabilities built in. This commit also adds a subsys stub because utlimately the logging will happen in the init phase but because the default log file is not set in the sys_logging init function, the stub is not useful for now. Signed-off-by: David Goulet --- configure.ac | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index cd014268bb..75fd709f9b 100644 --- a/configure.ac +++ b/configure.ac @@ -273,9 +273,9 @@ if test "x$enable_tracing_instrumentation_lttng" = "xyes"; then On Debian, apt install liblttng-ust-dev"])], []) AC_DEFINE([USE_TRACING_INSTRUMENTATION_LTTNG], [1], [Using LTTng instrumentation]) TOR_TRACE_LIBS="-llttng-ust -ldl" + have_tracing=1 fi - dnl USDT instrumentation option. AC_ARG_ENABLE(tracing-instrumentation-usdt, AS_HELP_STRING([--enable-tracing-instrumentation-usdt], @@ -291,6 +291,7 @@ if test "x$enable_tracing_instrumentation_usdt" = "xyes"; then dnl --with-sdt. There is unfortunately no way to check that so we always dnl build the USDT probes even though LTTng instrumentation was requested. AC_DEFINE([USE_TRACING_INSTRUMENTATION_USDT], [1], [Using USDT instrumentation]) + have_tracing=1 fi dnl Tracepoints event to debug logs. @@ -301,6 +302,9 @@ AC_ARG_ENABLE(tracing-instrumentation-log-debug, [Tracepoints to log debug]), []) AM_CONDITIONAL([USE_TRACING_INSTRUMENTATION_LOG_DEBUG], [test "x$enable_tracing_instrumentation_log_debug" = "xyes"]) +if test "x$enable_tracing_instrumentation_log_debug" = "xyes"; then + have_tracing=1 +fi dnl Define that tracing is supported if any instrumentation is used. AM_COND_IF([USE_TRACING_INSTRUMENTATION_LOG_DEBUG], @@ -309,6 +313,7 @@ AM_COND_IF([USE_TRACING_INSTRUMENTATION_USDT], AC_DEFINE([HAVE_TRACING], [1], [Compiled with tracing support])) AM_COND_IF([USE_TRACING_INSTRUMENTATION_LTTNG], AC_DEFINE([HAVE_TRACING], [1], [Compiled with tracing support])) +AM_CONDITIONAL([USE_TRACING], [test "x$have_tracing" = x1 ]) dnl Finally, define the trace libs. AC_SUBST([TOR_TRACE_LIBS]) -- cgit v1.2.3-54-g00ecf