Add DEBUG_LOCKCONTENTION documentation to the developer notes

24.x
Jon Atack 3 years ago
parent 39a34b6877
commit 4394733331
No known key found for this signature in database
GPG Key ID: 796C4109063D4EAF

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

Loading…
Cancel
Save