Skip to content

Commit 69cc83d

Browse files
jonatackfanquake
authored andcommitted
Add DEBUG_LOCKCONTENTION documentation to the developer notes
Github-Pull: #24770 Rebassedd-From: 4394733
1 parent 6374e24 commit 69cc83d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/developer-notes.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Developer Notes
1717
- [`debug.log`](#debuglog)
1818
- [Signet, testnet, and regtest modes](#signet-testnet-and-regtest-modes)
1919
- [DEBUG_LOCKORDER](#debug_lockorder)
20+
- [DEBUG_LOCKCONTENTION](#debug_lockcontention)
2021
- [Valgrind suppressions file](#valgrind-suppressions-file)
2122
- [Compiling for test coverage](#compiling-for-test-coverage)
2223
- [Performance profiling with perf](#performance-profiling-with-perf)
@@ -316,6 +317,19 @@ configure option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts
316317
run-time checks to keep track of which locks are held and adds warnings to the
317318
`debug.log` file if inconsistencies are detected.
318319

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+
319333
### Assertions and Checks
320334

321335
The util file `src/util/check.h` offers helpers to protect against coding and

0 commit comments

Comments
 (0)