Skip to content

Commit 933ab8a

Browse files
jb55laanwj
authored andcommitted
build: detect sys/sdt.h for eBPF tracing
1 parent f3e1768 commit 933ab8a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

configure.ac

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ AC_ARG_WITH([bdb],
129129
[use_bdb=$withval],
130130
[use_bdb=auto])
131131

132+
AC_ARG_ENABLE([ebpf],
133+
[AS_HELP_STRING([--enable-ebpf],
134+
[enable eBPF tracing (default is yes if sys/sdt.h is found)])],
135+
[use_ebpf=$enableval],
136+
[use_ebpf=yes])
137+
132138
AC_ARG_WITH([miniupnpc],
133139
[AS_HELP_STRING([--with-miniupnpc],
134140
[enable UPNP (default is yes if libminiupnpc is found)])],
@@ -1256,6 +1262,16 @@ if test x$enable_wallet != xno; then
12561262
fi
12571263
fi
12581264

1265+
if test x$use_ebpf != xno; then
1266+
AC_CHECK_HEADER([sys/sdt.h], [have_sdt=yes], [have_sdt=no])
1267+
else
1268+
have_sdt=no
1269+
fi
1270+
1271+
if test x$have_sdt = xyes; then
1272+
AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable eBPF user static defined tracepoints])
1273+
fi
1274+
12591275
dnl Check for libminiupnpc (optional)
12601276
if test x$use_upnp != xno; then
12611277
AC_CHECK_HEADERS(
@@ -1610,6 +1626,7 @@ AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
16101626
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
16111627
AM_CONDITIONAL([USE_SQLITE], [test "x$use_sqlite" = "xyes"])
16121628
AM_CONDITIONAL([USE_BDB], [test "x$use_bdb" = "xyes"])
1629+
AM_CONDITIONAL([ENABLE_TRACING],[test x$have_sdt = xyes])
16131630
AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes])
16141631
AM_CONDITIONAL([ENABLE_FUZZ],[test x$enable_fuzz = xyes])
16151632
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
@@ -1768,6 +1785,7 @@ fi
17681785
echo " with bench = $use_bench"
17691786
echo " with upnp = $use_upnp"
17701787
echo " use asm = $use_asm"
1788+
echo " ebpf tracing = $have_sdt"
17711789
echo " sanitizers = $use_sanitizers"
17721790
echo " debug enabled = $enable_debug"
17731791
echo " gprof enabled = $enable_gprof"

0 commit comments

Comments
 (0)