aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-01-14 14:58:09 -0500
committerDavid Goulet <dgoulet@torproject.org>2020-07-08 09:10:08 -0400
commit668fc70a20c602bb0e74bf0e19589a17bb45b7ae (patch)
treeed8fe5a7b67ab070b99f0ee6604d4af870ef33f4 /configure.ac
parent70f031528d033562ae93cb97677cab060948fd8e (diff)
downloadtor-668fc70a20c602bb0e74bf0e19589a17bb45b7ae.tar.gz
tor-668fc70a20c602bb0e74bf0e19589a17bb45b7ae.zip
trace: Add USDT probes generation support
This commit adds both configure options and probe generation for tracepoints. Part of #32910 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 20 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 680111b10f..170d8dc204 100644
--- a/configure.ac
+++ b/configure.ac
@@ -258,6 +258,20 @@ AC_ARG_ENABLE(libscrypt,
dnl --- Tracing Options. ---
+dnl USDT instrumentation option.
+AC_ARG_ENABLE(tracing-instrumentation-usdt,
+ AS_HELP_STRING([--enable-tracing-instrumentation-usdt],
+ [build with tracing USDT instrumentation]))
+AM_CONDITIONAL([USE_TRACING_INSTRUMENTATION_USDT],
+ [test "x$enable_tracing_instrumentation_usdt" = "xyes"])
+
+if test "x$enable_tracing_instrumentation_usdt" = "xyes"; then
+ AC_CHECK_HEADERS([sys/sdt.h], [],
+ [AC_MSG_ERROR([USDT instrumentation requires sys/sdt.h header.
+ On Debian, apt install systemtap-sdt-dev])], [])
+ AC_DEFINE([USE_TRACING_INSTRUMENTATION_USDT], [1], [Using USDT instrumentation])
+fi
+
dnl Tracepoints event to debug logs.
AC_ARG_ENABLE(tracing-instrumentation-log-debug,
AS_HELP_STRING([--enable-tracing-instrumentation-log-debug],
@@ -267,9 +281,11 @@ AC_ARG_ENABLE(tracing-instrumentation-log-debug,
AM_CONDITIONAL([USE_TRACING_INSTRUMENTATION_LOG_DEBUG],
[test "x$enable_tracing_instrumentation_log_debug" = "xyes"])
-dnl Define that tracing is supported.
+dnl Define that tracing is supported if any instrumentation is used.
AM_COND_IF([USE_TRACING_INSTRUMENTATION_LOG_DEBUG],
AC_DEFINE([HAVE_TRACING], [1], [Compiled with tracing support]))
+AM_COND_IF([USE_TRACING_INSTRUMENTATION_USDT],
+ AC_DEFINE([HAVE_TRACING], [1], [Compiled with tracing support]))
dnl -- End Tracing Options. --
@@ -2731,6 +2747,9 @@ PPRINT_SUBTITLE([Tracing])
test "x$enable_tracing_instrumentation_log_debug" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL([Tracepoints to log_debug() (--enable-tracing-instrumentation-log-debug)], $value)
+test "x$enable_tracing_instrumentation_usdt" = "xyes" && value=1 || value=0
+PPRINT_PROP_BOOL([USDT Instrumentation (--enable-tracing-instrumentation-usdt)], $value)
+
AS_ECHO
PPRINT_SUBTITLE([Install Directories])