#36627 tracing: run USDT tests without BPF privileges

ReviewabilityReviewsAgreementSize
#36627 willcl-ark tracing: run USDT tests without BPF privilegesReady0Strong18 + 395 tests
  • Run USDT tracepoint functional tests without requiring root permissions, BCC, or matching kernel headers
  • Make tracepoint tests easier for developers to run locally while dropping privileged mode in CI
  • Ready to review
  • Substantive support for simplifying USDT testing by testing Core directly instead of BCC (0xB10C)
  • Concept approval without stated reasons (fanquake)
  • Questions on aarch64 compatibility and relation to broader tracing issues (0xB10C, maflcko)
  • Minor suggestions on CI comments and test configurations (maflcko)
  • 18 lines added or modified outside tests
  • 395 lines added or modified in tests
  • 1,073 lines removed in total
  • 12 files, 2 commits
Test infrastructure#18 of 54
P3 · cleanup
  • P3 because running USDT tests locally without root or kernel headers is a clear developer improvement
  • It eliminates heavy tracing dependencies and removes over 600 lines of test code
  • USDT testing remains a specialized developer workflow, so the cleanup is deferrable
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Replaces the BCC and eBPF tracing framework in USDT functional tests with GDB. Tested nodes run as debugger children that enable tracepoints and inspect probe arguments when hit. This removes dependencies on the BCC toolchain, matching host kernel headers, and elevated BPF privileges, allowing CI containers to drop privileged mode.

Problem: USDT functional tests require BCC, matching kernel headers, and root/BPF permissions. This makes tracepoint tests difficult to run locally and requires a privileged container in the ASan CI task.

Evidence of importance:

  • PR description: '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.'

Scope: Touches only functional test infrastructure, documentation, and CI configuration; no production node code is modified.

Risk of a mistake: low (tests, docs). Only touches functional tests, CI configurations, and tracing documentation; a bug could cause CI or test runner failures without risking node runtime or consensus.

Changed since the previous assessment: Diff provided; the implementation matches the previous description.

Reviewability

Ready

Nothing known that would invalidate a review now.

Waiting on (from the thread read):

  • author: answer questions from 0xB10C and maflcko, and address CI suggestions 2026-10-26

Agreement

Strong

substantive support, no open objection (0xB10C)

Thread notes: Added review comments and question from maflcko regarding how the change fits into issue 35142 and inline suggestions on CI files.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
0xB10C (member)question, scopeDoes this change also make the USDT tests work on aarch64?openansweredno2026-10-23: 'Does this also make the tests work aarch64 ref https://github.com/bitcoin/bitcoin/issues/35142#issuecomment-4959156870?'
maflcko (member)question, scopeHow does this change fit into the larger picture in issue 35142?openansweredno2026-10-26: 'How does this fit into the large picture in https://github.com/bitcoin/bitcoin/issues/35142 ?'
maflcko (member)suggestion, maintenanceRemove the comment in ci.ymlopenansweredno2026-10-26: 'remove the comment?'
maflcko (member)suggestion, maintenanceBump like all other sanitizer testsopenansweredno2026-10-26: 'bump, like all other sanitizer tests?'

Support:

  • fanquake (member) (Concept ACK, 2026-10-23): (no reason given) [not substantive]
  • 0xB10C (member) (Concept ACK, 2026-10-23) [read]: agrees it is a nice simplification to test the Bitcoin Core interface rather than BCC

Participants:

  • 0xB10C (member, support, 1 statements 2026-10-23 to 2026-10-23): Concept ACK; asked if this enables USDT tests on aarch64
  • fanquake (member, support, 2 statements 2026-10-23 to 2026-10-23): Concept ACK
  • maflcko (member, question, 3 statements 2026-10-26 to 2026-10-26): asked how this fits into issue 35142 and left CI inline comments

Files

1462 lines under test/bench/ci.

  • test/functional/interface_usdt_net.py +76/-362
  • test/functional/interface_usdt_utxocache.py +55/-245
  • test/functional/interface_usdt_mempool.py +33/-198
  • test/functional/interface_usdt_coinselection.py +60/-145
  • test/functional/test_framework/usdt.py +144/-0
  • test/functional/interface_usdt_validation.py +14/-80
  • test/functional/test_framework/test_framework.py +11/-12
  • doc/tracing.md +18/-0
  • ci/test/00_setup_env_native_asan.sh +2/-10
  • ci/test/03_test_script.sh +0/-8
  • test/functional/test_framework/util.py +0/-7
  • .github/workflows/ci.yml +0/-6

Card

The short text the ranking pass compares across PRs.

This PR replaces the BCC and eBPF tracing toolchain in USDT functional tests with GDB. Testing USDT probes previously required BCC, host kernel headers, and root privileges to load BPF programs, which prevented unprivileged local execution and required a privileged Docker container in ASan CI. Tracing through GDB verifies probe metadata, triggers, and argument values without elevated permissions while removing roughly 660 lines of embedded BPF and CI code. The trade-off is that external eBPF loading paths are not exercised and LeakSanitizer must be disabled on the traced children due to ptrace limitations.

Data

dossier JSON · extract JSON · model ledger, generated 2026-10-27T01:28, confidence high, input hash affeb058d299c083
thread read through 2026-10-26 (7 statements), head e0ef6fd65a
labels: none

Categories

Test infrastructure

P3 · cleanup

Replacing BCC and eBPF with GDB removes heavy external dependencies, root permissions, and over 600 lines of test code. Running USDT tests locally without host kernel headers or elevated privileges is a clear usability improvement for developers, though reasonably deferrable.

Membership: Overhauls USDT functional test framework utilities and multiple test scripts (+413/-1073 in test/functional/).

Factors: security/stability 1, bug 0, performance 0, user value 0, leverage 1