Skip to content

Commit bd57b4e

Browse files
committed
Merge bitcoin/bitcoin#24757: build, ci: add DEBUG_LOCKCONTENTION to --enable-debug and CI
bd5dbc3 doc: update developer notes wrt --enable-debug and DEBUG_LOCKCONTENTION (Jon Atack) 345647c ci: add DEBUG_LOCKCONTENTION to CI task containing DEBUG_LOCKORDER (Jon Atack) 247d170 build: add DEBUG_LOCKCONTENTION to --enable-debug configuration (Jon Atack) Pull request description: - Add `DEBUG_LOCKCONTENTION` flag to the `--enable-debug` configuration - Add `DEBUG_LOCKCONTENTION` to the native tsan CI task that contains `DEBUG_LOCKORDER` (verified that the CI has all logging categories enabled by default, except libevent and leveldb) - Update the developer notes that `--enable-debug` configures `DEBUG_LOCKCONTENTION` Related to bitcoin/bitcoin#24709. Top commit has no ACKs. Tree-SHA512: 8e9c068d9a4841ad1ab08a2bf4ce96d6fee195e458f6802852cba0d71deb9a485059d355ac8bd1fc15410437f19503b77fc425bf53a1d48dc82a43a979daad17
2 parents 90e49c1 + bd5dbc3 commit bd57b4e

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
@@ -11,4 +11,4 @@ export DOCKER_NAME_TAG=ubuntu:22.04
1111
export PACKAGES="clang-13 llvm-13 libc++abi-13-dev libc++-13-dev python3-zmq"
1212
export DEP_OPTS="CC=clang-13 CXX='clang++-13 -stdlib=libc++'"
1313
export GOAL="install"
14-
export BITCOIN_CONFIG="--enable-zmq CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' CXXFLAGS='-g' --with-sanitizers=thread CC=clang-13 CXX='clang++-13 -stdlib=libc++'"
14+
export BITCOIN_CONFIG="--enable-zmq CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION' CXXFLAGS='-g' --with-sanitizers=thread CC=clang-13 CXX='clang++-13 -stdlib=libc++'"

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ if test "$enable_debug" = "yes"; then
378378

379379
AX_CHECK_PREPROC_FLAG([-DDEBUG], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG"], [], [$CXXFLAG_WERROR])
380380
AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"], [], [$CXXFLAG_WERROR])
381+
AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKCONTENTION], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKCONTENTION"], [], [$CXXFLAG_WERROR])
381382
AX_CHECK_PREPROC_FLAG([-DRPC_DOC_CHECK], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DRPC_DOC_CHECK"], [], [$CXXFLAG_WERROR])
382383
AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"], [], [$CXXFLAG_WERROR])
383384
AX_CHECK_COMPILE_FLAG([-ftrapv], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -ftrapv"], [], [$CXXFLAG_WERROR])

doc/developer-notes.md

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

397-
To enable it, run configure with `-DDEBUG_LOCKCONTENTION` added to your
398-
CPPFLAGS, e.g. `CPPFLAGS="-DDEBUG_LOCKCONTENTION"`, then build and run bitcoind.
397+
The `--enable-debug` configure option adds `-DDEBUG_LOCKCONTENTION` to the
398+
compiler flags. You may also enable it manually for a non-debug build by running
399+
configure with `-DDEBUG_LOCKCONTENTION` added to your CPPFLAGS,
400+
i.e. `CPPFLAGS="-DDEBUG_LOCKCONTENTION"`, then build and run bitcoind.
399401

400402
You can then use the `-debug=lock` configuration option at bitcoind startup or
401403
`bitcoin-cli logging '["lock"]'` at runtime to turn on lock contention logging.

0 commit comments

Comments
 (0)