@@ -17,6 +17,7 @@ Developer Notes
17
17
- [ ` debug.log ` ] ( #debuglog )
18
18
- [ Signet, testnet, and regtest modes] ( #signet-testnet-and-regtest-modes )
19
19
- [ DEBUG_LOCKORDER] ( #debug_lockorder )
20
+ - [ DEBUG_LOCKCONTENTION] ( #debug_lockcontention )
20
21
- [ Valgrind suppressions file] ( #valgrind-suppressions-file )
21
22
- [ Compiling for test coverage] ( #compiling-for-test-coverage )
22
23
- [ Performance profiling with perf] ( #performance-profiling-with-perf )
@@ -362,6 +363,19 @@ configure option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts
362
363
run-time checks to keep track of which locks are held and adds warnings to the
363
364
` debug.log ` file if inconsistencies are detected.
364
365
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
+
365
379
### Assertions and Checks
366
380
367
381
The util file ` src/util/check.h ` offers helpers to protect against coding and
0 commit comments