Repository navigation
tracing: run USDT tests without BPF privileges - #36627
willcl-ark wants to merge 2 commits into
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste 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. LLM Linter (✨ experimental)Possible places where comparison-specific test macros should replace generic comparisons:
2026-11-05 15:31:11 |
|
Concept ACK |
|
cc @0xB10C |
|
I beefed up the tradeoffs section here as I think it may have been undersold in its previous form. |
|
Concept ACK. Nice, I didn't know this was possible. I think it's a nice simplification and agree that we should test our interface, and not bcc which might or might not break from time to time. I plan to review this in more detail. Does this also make the tests work aarch64 ref #35142 (comment)? |
e0ef6fd to
89e34fb
Compare
Sorry meant to reply here sooner but got distracted. Of course the value to us of this patchset depends somewhat on whether we opt to keep tracing in-repo (vs as an external patchset). If we want to drop it, then this change is moot. With b10c and the FIBRE team both using tracing actively it seems both would (naturally) prefer to keep it in-tree if possible. This seems fine to me, and I see this patchset as reducing the maintenance burden (to us) of keeping it here in its current form as it:
|
Launch traced nodes as GDB children so the existing probe scenarios can run without BCC, BPF privileges, or matching host kernel headers. - Copy probe arguments while stopped and drain complete records in the test process, including events emitted during node shutdown and restart. - Follow the bitcoin launcher through exec before registering probes. - Handle a GDB parser failure for GCC byte-register operands in usdt.py. - Disable LeakSanitizer only for traced children because it cannot operate under ptrace; keep other sanitizer checks remain enabled.
The USDT tests now launch nodes under GDB, so the ASan job no longer needs BCC, matching host kernel headers, or a privileged container. Install GDB and binutils and retain SYS_PTRACE for debugger and sanitizer operation. Remove the host-kernel package refresh and BCC workflow toggle along with the dependencies they supported.
89e34fb to
ad73514
Compare
|
Pushed to take one ralph finding. The other suggestion does highlight a possible limitation, but I don't think it affects anything. The current binary has one site per probe name, so the fallback selects the correct layout. |
|
Concept ACK |

The USDT functional tests currently use BCC to attach eBPF programs to Bitcoin Core’s tracepoints. This requires BCC, matching kernel headers, and elevated BPF permissions, making the tests awkward to run locally and
requiring a privileged container in CI.
Replace the BCC consumers with GDB. Each tested node runs as a debugger child, allowing the tests to enable the real USDT probes and inspect their arguments when execution reaches the probe location. This continues to test
the parts of the USDT interface provided by Bitcoin Core:
All five tests can run with GDB and
binutils, without BCC or matching kernel headers. The ASan CI job no longer needs a privileged container and usesSYS_PTRACEinstead. This also removes the embedded BPF programs fromthe tests, reducing their size and maintenance burden. Overall, the change removes roughly 660 lines of test and CI code.
Tradeoffs
those components would no longer be detected here.
ptrace. Other sanitizer checks remain enabled.The remaining coverage is focused on Bitcoin Core’s side of the USDT interface. Testing the general BCC, eBPF, and kernel uprobe is left to those consumers and the kernel.