aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2022-04-04 11:42:27 +0200
committerfanquake <fanquake@gmail.com>2022-04-08 13:27:02 +0100
commit69cc83df69e5a9306a0090df0dade38d5383af4d (patch)
treed9e55f0fd45fa11c8890dbac70060fe63438b45e
parent6374e24887e3957cfcf17841a8c48cac2ffbda4f (diff)
Add DEBUG_LOCKCONTENTION documentation to the developer notes
Github-Pull: #24770 Rebassedd-From: 43947333315d07f59e1247bd76e0ba9d35a99e31
-rw-r--r--doc/developer-notes.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index bfb64093e1..5bb927c44e 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)
@@ -316,6 +317,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