mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
merge bitcoin#19866: eBPF Linux tracepoints
This commit is contained in:
parent
772a3affce
commit
e5445e5444
18
configure.ac
18
configure.ac
@ -132,6 +132,12 @@ AC_ARG_WITH([bdb],
|
|||||||
[use_bdb=$withval],
|
[use_bdb=$withval],
|
||||||
[use_bdb=auto])
|
[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],
|
AC_ARG_WITH([miniupnpc],
|
||||||
[AS_HELP_STRING([--with-miniupnpc],
|
[AS_HELP_STRING([--with-miniupnpc],
|
||||||
[enable UPNP (default is yes if libminiupnpc is found)])],
|
[enable UPNP (default is yes if libminiupnpc is found)])],
|
||||||
@ -1368,6 +1374,16 @@ if test x$enable_wallet != xno; then
|
|||||||
fi
|
fi
|
||||||
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)
|
dnl Check for libminiupnpc (optional)
|
||||||
if test x$use_upnp != xno; then
|
if test x$use_upnp != xno; then
|
||||||
AC_CHECK_HEADERS(
|
AC_CHECK_HEADERS(
|
||||||
@ -1740,6 +1756,7 @@ AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
|
|||||||
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
|
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
|
||||||
AM_CONDITIONAL([USE_SQLITE], [test "x$use_sqlite" = "xyes"])
|
AM_CONDITIONAL([USE_SQLITE], [test "x$use_sqlite" = "xyes"])
|
||||||
AM_CONDITIONAL([USE_BDB], [test "x$use_bdb" = "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_TESTS],[test x$BUILD_TEST = xyes])
|
||||||
AM_CONDITIONAL([ENABLE_FUZZ],[test x$enable_fuzz = xyes])
|
AM_CONDITIONAL([ENABLE_FUZZ],[test x$enable_fuzz = xyes])
|
||||||
AM_CONDITIONAL([ENABLE_FUZZ_BINARY],[test x$enable_fuzz_binary = xyes])
|
AM_CONDITIONAL([ENABLE_FUZZ_BINARY],[test x$enable_fuzz_binary = xyes])
|
||||||
@ -1905,6 +1922,7 @@ echo " with bench = $use_bench"
|
|||||||
echo " with upnp = $use_upnp"
|
echo " with upnp = $use_upnp"
|
||||||
echo " with natpmp = $use_natpmp"
|
echo " with natpmp = $use_natpmp"
|
||||||
echo " use asm = $use_asm"
|
echo " use asm = $use_asm"
|
||||||
|
echo " ebpf tracing = $have_sdt"
|
||||||
echo " sanitizers = $use_sanitizers"
|
echo " sanitizers = $use_sanitizers"
|
||||||
echo " debug enabled = $enable_debug"
|
echo " debug enabled = $enable_debug"
|
||||||
echo " stacktraces enabled = $enable_stacktraces"
|
echo " stacktraces enabled = $enable_stacktraces"
|
||||||
|
@ -332,6 +332,7 @@ BITCOIN_CORE_H = \
|
|||||||
util/string.h \
|
util/string.h \
|
||||||
util/time.h \
|
util/time.h \
|
||||||
util/threadnames.h \
|
util/threadnames.h \
|
||||||
|
util/trace.h \
|
||||||
util/translation.h \
|
util/translation.h \
|
||||||
util/vector.h \
|
util/vector.h \
|
||||||
util/url.h \
|
util/url.h \
|
||||||
|
45
src/util/trace.h
Normal file
45
src/util/trace.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// Copyright (c) 2020 The Bitcoin Core developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#ifndef BITCOIN_UTIL_TRACE_H
|
||||||
|
#define BITCOIN_UTIL_TRACE_H
|
||||||
|
|
||||||
|
#ifdef ENABLE_TRACING
|
||||||
|
|
||||||
|
#include <sys/sdt.h>
|
||||||
|
|
||||||
|
#define TRACE(context, event) DTRACE_PROBE(context, event)
|
||||||
|
#define TRACE1(context, event, a) DTRACE_PROBE1(context, event, a)
|
||||||
|
#define TRACE2(context, event, a, b) DTRACE_PROBE2(context, event, a, b)
|
||||||
|
#define TRACE3(context, event, a, b, c) DTRACE_PROBE3(context, event, a, b, c)
|
||||||
|
#define TRACE4(context, event, a, b, c, d) DTRACE_PROBE4(context, event, a, b, c, d)
|
||||||
|
#define TRACE5(context, event, a, b, c, d, e) DTRACE_PROBE5(context, event, a, b, c, d, e)
|
||||||
|
#define TRACE6(context, event, a, b, c, d, e, f) DTRACE_PROBE6(context, event, a, b, c, d, e, f)
|
||||||
|
#define TRACE7(context, event, a, b, c, d, e, f, g) DTRACE_PROBE7(context, event, a, b, c, d, e, f, g)
|
||||||
|
#define TRACE8(context, event, a, b, c, d, e, f, g, h) DTRACE_PROBE8(context, event, a, b, c, d, e, f, g, h)
|
||||||
|
#define TRACE9(context, event, a, b, c, d, e, f, g, h, i) DTRACE_PROBE9(context, event, a, b, c, d, e, f, g, h, i)
|
||||||
|
#define TRACE10(context, event, a, b, c, d, e, f, g, h, i, j) DTRACE_PROBE10(context, event, a, b, c, d, e, f, g, h, i, j)
|
||||||
|
#define TRACE11(context, event, a, b, c, d, e, f, g, h, i, j, k) DTRACE_PROBE11(context, event, a, b, c, d, e, f, g, h, i, j, k)
|
||||||
|
#define TRACE12(context, event, a, b, c, d, e, f, g, h, i, j, k, l) DTRACE_PROBE12(context, event, a, b, c, d, e, f, g, h, i, j, k, l)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define TRACE(context, event)
|
||||||
|
#define TRACE1(context, event, a)
|
||||||
|
#define TRACE2(context, event, a, b)
|
||||||
|
#define TRACE3(context, event, a, b, c)
|
||||||
|
#define TRACE4(context, event, a, b, c, d)
|
||||||
|
#define TRACE5(context, event, a, b, c, d, e)
|
||||||
|
#define TRACE6(context, event, a, b, c, d, e, f)
|
||||||
|
#define TRACE7(context, event, a, b, c, d, e, f, g)
|
||||||
|
#define TRACE8(context, event, a, b, c, d, e, f, g, h)
|
||||||
|
#define TRACE9(context, event, a, b, c, d, e, f, g, h, i)
|
||||||
|
#define TRACE10(context, event, a, b, c, d, e, f, g, h, i, j)
|
||||||
|
#define TRACE11(context, event, a, b, c, d, e, f, g, h, i, j, k)
|
||||||
|
#define TRACE12(context, event, a, b, c, d, e, f, g, h, i, j, k, l)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* BITCOIN_UTIL_TRACE_H */
|
Loading…
Reference in New Issue
Block a user