@@ -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 )
@@ -316,6 +317,19 @@ configure option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts
316
317
run-time checks to keep track of which locks are held and adds warnings to the
317
318
` debug.log ` file if inconsistencies are detected.
318
319
320
+ ### DEBUG_LOCKCONTENTION
321
+
322
+ Defining ` DEBUG_LOCKCONTENTION ` adds a "lock" logging category to the logging
323
+ RPC that, when enabled, logs the location and duration of each lock contention
324
+ to the ` debug.log ` file.
325
+
326
+ To enable it, run configure with ` -DDEBUG_LOCKCONTENTION ` added to your
327
+ CPPFLAGS, e.g. ` CPPFLAGS="-DDEBUG_LOCKCONTENTION" ` , then build and run bitcoind.
328
+
329
+ You can then use the ` -debug=lock ` configuration option at bitcoind startup or
330
+ ` bitcoin-cli logging '["lock"]' ` at runtime to turn on lock contention logging.
331
+ It can be toggled off again with ` bitcoin-cli logging [] '["lock"]' ` .
332
+
319
333
### Assertions and Checks
320
334
321
335
The util file ` src/util/check.h ` offers helpers to protect against coding and
0 commit comments