Skip to content

Commit ff6304f

Browse files
committed
merge bitcoin#24757: add DEBUG_LOCKCONTENTION to --enable-debug and CI
1 parent 88592f3 commit ff6304f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

ci/test/00_setup_env_native_tsan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export TEST_RUNNER_EXTRA="--extended --exclude feature_pruning,feature_dbcrash,w
1313
export TEST_RUNNER_EXTRA="${TEST_RUNNER_EXTRA} --timeout-factor=4" # Increase timeout because sanitizers slow down
1414
export GOAL="install"
1515
export BITCOIN_CONFIG="--enable-zmq --with-gui=no --with-sanitizers=thread CC=clang-16 CXX=clang++-16 CXXFLAGS='-g' --with-boost-process"
16-
export CPPFLAGS="-DDEBUG_LOCKORDER -DARENA_DEBUG"
16+
export CPPFLAGS="-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION"
1717
export PYZMQ=true

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ if test "x$enable_debug" = xyes; then
389389

390390
AX_CHECK_PREPROC_FLAG([-DDEBUG_CORE],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_CORE"]],,[[$CXXFLAG_WERROR]])
391391
AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"]],,[[$CXXFLAG_WERROR]])
392+
AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKCONTENTION], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKCONTENTION"], [], [$CXXFLAG_WERROR])
392393
AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"]],,[[$CXXFLAG_WERROR]])
393394
AX_CHECK_COMPILE_FLAG([-ftrapv],[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -ftrapv"],,[[$CXXFLAG_WERROR]])
394395
else

doc/developer-notes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,10 @@ Defining `DEBUG_LOCKCONTENTION` adds a "lock" logging category to the logging
419419
RPC that, when enabled, logs the location and duration of each lock contention
420420
to the `debug.log` file.
421421

422-
To enable it, run configure with `-DDEBUG_LOCKCONTENTION` added to your
423-
CPPFLAGS, e.g. `CPPFLAGS="-DDEBUG_LOCKCONTENTION"`, then build and run dashd.
422+
The `--enable-debug` configure option adds `-DDEBUG_LOCKCONTENTION` to the
423+
compiler flags. You may also enable it manually for a non-debug build by running
424+
configure with `-DDEBUG_LOCKCONTENTION` added to your CPPFLAGS,
425+
i.e. `CPPFLAGS="-DDEBUG_LOCKCONTENTION"`, then build and run dashd.
424426

425427
You can then use the `-debug=lock` configuration option at dashd startup or
426428
`dash-cli logging '["lock"]'` at runtime to turn on lock contention logging.

0 commit comments

Comments
 (0)