POC: IPC tracing interface#32898
Conversation
Add a MakeBasicInit() function so simpler standalone IPC clients like bitcoin-mine in bitcoin#30437 and bitcoin-cli in bitcoin#32297 that only initiate IPC connections without exposing any IPC interfaces themselves can to avoid needing to implement their own specialized interfaces::Init subclasses.
Allows InitError and InitWarning to be used by other executables beside bitcoind and bitcoin-node.
Add kernel::Traces struct and pass it places where it will be used next commit to support emitting IPC traces. Similar structs like wallet::Traces could be added to enable traces from other parts of the code.
This a is proof-of-concept adding an IPC interface for tracing as discussed in bitcoin-core/libmultiprocess#185. As mentioned there, this is a naive implementation that would need to be optimized to have good performance, but it does show an end-to-end demo of how tracing could work using IPC. The can be tested by building with -DENABLE_IPC=ON and running: build/bin/bitcoin-node -regtest -ipcbind=unix # Start node listening on IPC socket build/bin/bitcoin-trace -regtest -debug # Run bitcoin-trace and connect to socket build/bin/bitcoin-cli -regtest -generate # Create a block to generate sample traces
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32898. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Notes on current implementation of this:
|
|
Awesome, thanks! I'll play around with this over the next few weeks. |
Great! Will close this PR since I'm not planning to do more work on it, and we can continue to discuss in bitcoin-core/libmultiprocess#185 |
|
Note: @willcl-ark did some followup based on this PR: https://github.com/bitcoin-dev-tools/ipc-exporter-rust/blob/master/report.md And these seems to be more discussion about something similar tracing or monitoring here: peer-observer/peer-observer#141 I haven't been following these efforts very much but they look promising and wanted to add the links. |
This a is proof-of-concept adding an IPC interface for tracing as discussed in bitcoin-core/libmultiprocess#185. As mentioned there, this is a naive implementation that would need to be optimized to have good performance, but it does show an end-to-end demo of how tracing could work using IPC.
The can be tested by building with
-DENABLE_IPC=ONand running: