Currently there is a macro DEBUG_LOCKCONTENTION
(see developer-notes.md) to enable logging of contention. The disadvantage of this method is that bitcoind
needs to be especially compiled with that enabled, and when enabled this quickly produces huge log files, and has a relatively large overhead.
This is a rework of PR #25081.
Previously the binary(bitcoind
) shows multiple ELF notes which is problematic as it can bloat the binary with redundant metadata, and can also confuse tracing tools(bcc, etc) when using binary path. see comment.
I am keeping this as DRAFT for now and research more on the better way to handle the duplication of ELF notes, currently we use a check to omit multiple instantiation of TRACEPOINT. After a suitable workaround is found, I will be updating the commits with bpftrace scripts for lock analysis.
CC 0xB10C