aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorWilliam Casarin <jb55@jb55.com>2020-09-05 07:36:47 -0700
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-12-07 11:55:51 +0100
commit933ab8a720cb9b3341adec4109cffb6dc5b322a5 (patch)
tree894dc1575f7011a205010d77d21f8697b3d5630d /configure.ac
parentf3e17686b37a70860bd4636f54c77da6fef59240 (diff)
downloadbitcoin-933ab8a720cb9b3341adec4109cffb6dc5b322a5.tar.xz
build: detect sys/sdt.h for eBPF tracing
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 32d1138653..f0ab410d72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,6 +129,12 @@ AC_ARG_WITH([bdb],
[use_bdb=$withval],
[use_bdb=auto])
+AC_ARG_ENABLE([ebpf],
+ [AS_HELP_STRING([--enable-ebpf],
+ [enable eBPF tracing (default is yes if sys/sdt.h is found)])],
+ [use_ebpf=$enableval],
+ [use_ebpf=yes])
+
AC_ARG_WITH([miniupnpc],
[AS_HELP_STRING([--with-miniupnpc],
[enable UPNP (default is yes if libminiupnpc is found)])],
@@ -1256,6 +1262,16 @@ if test x$enable_wallet != xno; then
fi
fi
+if test x$use_ebpf != xno; then
+ AC_CHECK_HEADER([sys/sdt.h], [have_sdt=yes], [have_sdt=no])
+else
+ have_sdt=no
+fi
+
+if test x$have_sdt = xyes; then
+ AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable eBPF user static defined tracepoints])
+fi
+
dnl Check for libminiupnpc (optional)
if test x$use_upnp != xno; then
AC_CHECK_HEADERS(
@@ -1610,6 +1626,7 @@ AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
AM_CONDITIONAL([USE_SQLITE], [test "x$use_sqlite" = "xyes"])
AM_CONDITIONAL([USE_BDB], [test "x$use_bdb" = "xyes"])
+AM_CONDITIONAL([ENABLE_TRACING],[test x$have_sdt = xyes])
AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes])
AM_CONDITIONAL([ENABLE_FUZZ],[test x$enable_fuzz = xyes])
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
@@ -1768,6 +1785,7 @@ fi
echo " with bench = $use_bench"
echo " with upnp = $use_upnp"
echo " use asm = $use_asm"
+echo " ebpf tracing = $have_sdt"
echo " sanitizers = $use_sanitizers"
echo " debug enabled = $enable_debug"
echo " gprof enabled = $enable_gprof"