Skip to content

Commit

Permalink
build: detect sys/sdt.h for eBPF tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 authored and laanwj committed Dec 7, 2020
1 parent f3e1768 commit 933ab8a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions configure.ac
Expand Up @@ -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)])],
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 933ab8a

Please sign in to comment.