diff options
author | Jon Atack <jon@atack.com> | 2022-04-04 11:42:27 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-04-05 12:49:50 +0200 |
commit | 43947333315d07f59e1247bd76e0ba9d35a99e31 (patch) | |
tree | 55126e824b5e57a04b20e7dc03312e034ce23345 /doc | |
parent | 39a34b6877945908759f6a2322f60852e521e2ee (diff) |
Add DEBUG_LOCKCONTENTION documentation to the developer notes
Diffstat (limited to 'doc')
-rw-r--r-- | doc/developer-notes.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md index c3ab3fa953..f06902e624 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -17,6 +17,7 @@ Developer Notes - [`debug.log`](#debuglog) - [Signet, testnet, and regtest modes](#signet-testnet-and-regtest-modes) - [DEBUG_LOCKORDER](#debug_lockorder) + - [DEBUG_LOCKCONTENTION](#debug_lockcontention) - [Valgrind suppressions file](#valgrind-suppressions-file) - [Compiling for test coverage](#compiling-for-test-coverage) - [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 `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 The util file `src/util/check.h` offers helpers to protect against coding and |