Skip to content

Bench: add -debug option to bench_bitcoin

Summary

While working on my mempool branch, I found it useful to be able to see LogPrintf output from bench_bitcoin while testing out ideas and trying new approaches.

As such, I am proposing we add a -debug option to bench_bitcoin.

What it does: When it's specified, it enables console output (which is normally suppressed) -- so you see all the normal LogPrintfs.

You can also pick a debug logging category (sams as you can do with regular bitcoind) and get specific LogPrintfs e.g. related to things like finalization or bench or mempool, etc. (Try bench_bitcoin -h to see a list of categories).

I found it very useful to be able to do see printed output from the code I was benchmarking while working on new code and while testing out new ideas... so I am offering this up to the project to also help others in their dev work.

Test Plan

  • ninja bench_bitcoin

  • src/bench/bench_bitcoin -h <-- review help text (this is taken verbatim from existing init.cpp help text for this option in bitcoind).

  • Try the debug options out e.g.:

    $ src/bench/bench_bitcoin -filter='Reorg.*' -debug=bench

Etc...

Merge request reports