@@ -17,6 +17,7 @@ Developer Notes
1717 - [ ` debug.log ` ] ( #debuglog )
1818 - [ Signet, testnet, and regtest modes] ( #signet-testnet-and-regtest-modes )
1919 - [ DEBUG_LOCKORDER] ( #debug_lockorder )
20+ - [ DEBUG_LOCKCONTENTION] ( #debug_lockcontention )
2021 - [ Valgrind suppressions file] ( #valgrind-suppressions-file )
2122 - [ Compiling for test coverage] ( #compiling-for-test-coverage )
2223 - [ Performance profiling with perf] ( #performance-profiling-with-perf )
@@ -362,6 +363,19 @@ configure option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts
362363run-time checks to keep track of which locks are held and adds warnings to the
363364` debug.log ` file if inconsistencies are detected.
364365
366+ ### DEBUG_LOCKCONTENTION
367+
368+ Defining ` DEBUG_LOCKCONTENTION ` adds a "lock" logging category to the logging
369+ RPC that, when enabled, logs the location and duration of each lock contention
370+ to the ` debug.log ` file.
371+
372+ To enable it, run configure with ` -DDEBUG_LOCKCONTENTION ` added to your
373+ CPPFLAGS, e.g. ` CPPFLAGS="-DDEBUG_LOCKCONTENTION" ` , then build and run bitcoind.
374+
375+ You can then use the ` -debug=lock ` configuration option at bitcoind startup or
376+ ` bitcoin-cli logging '["lock"]' ` at runtime to turn on lock contention logging.
377+ It can be toggled off again with ` bitcoin-cli logging [] '["lock"]' ` .
378+
365379### Assertions and Checks
366380
367381The util file ` src/util/check.h ` offers helpers to protect against coding and
0 commit comments