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:
- the probe metadata is present and understood;
- the probes can be enabled and are reached in the expected scenarios; and
- their arguments have the expected values, sizes, and lifetimes.
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 uses SYS_PTRACE instead. This also removes the embedded BPF programs from
the tests, reducing their size and maintenance burden. Overall, the change removes roughly 660 lines of test and CI code.
Tradeoffs
- These tests no longer exercise the consumer-side eBPF path, including BCC compilation, kernel BPF verification and loading, uprobe attachment, BPF-side argument decoding, and perf-buffer delivery. Problems confined to those components would no longer be detected here.
- LeakSanitizer is disabled for nodes run under GDB because it cannot operate under
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.