4 suggestions
Optional improvements
[suggestion] · GDB capture does not assert integer argument types
Value-preserving width changes can pass the USDT tests because capture converts arguments to Python integers without checking the documented widths or signedness.
Location: test/functional/test_framework/usdt.py:103 (head).
Details and suggested fix
Probe.stop() converts each $_probe_argN to int before checking anything except argument count, and numeric fields specify only "i". For example, widening normal_create_tx_internal's documented int32 change_pos to signed int64 would still satisfy the existing -1 assertions. Negative-value assertions catch some signedness changes, but they do not establish the declared integer types. Add expected widths and signedness to the field schemas and compare them with GDB's argument type metadata before conversion, checking the parsed N@ prefix in the readelf fallback. This preserves the existing value and lifetime checks while covering the integer sizes promised in the PR description.
[suggestion] · Runtime probe enabling is no longer exercised
Enabling every probe before daemon initialization leaves the USDT tests unable to detect regressions specific to consumers attaching to an already-running node.
Location: test/functional/test_framework/usdt.py:38 (head).
Details and suggested fix
The direct launch registers probe breakpoints before run, and the launcher path registers them at the exec catchpoint before continuing daemon initialization. They remain enabled throughout each run; clear() only drains captured events. The previous tests attached after startup, as contrib/tracing consumers do by PID. TRACEPOINT_ACTIVE currently reads the semaphore on every call, so production behavior is correct, but these tests would miss a regression that cached its startup value. Keep at least one scenario that enables initially disabled probes after RPC readiness and then verifies capture. That needs additional GDB control; if startup-only enabling is intentional, list this Bitcoin Core-side coverage loss explicitly in the tradeoffs.
[suggestion] · readelf fallback conflates multiple locations of a probe
If a probe has multiple compiled locations with different operands, the byte-register fallback can record incorrect arguments by using one location's layout for every hit.
Location: test/functional/test_framework/usdt.py:109 (head).
Details and suggested fix
When GDB reports the r8b–r15b parser error, the fallback keys readelf notes only by provider:name. Duplicate notes overwrite one another, and self.operands then reuses the last layout at every location covered by the named breakpoint. Inlining or cloning can produce such locations, and matching argument counts do not imply matching registers or stack slots. Incorrect captures could cause misleading test failures or pass loose value assertions. No current build was shown to emit multiple notes for a tested probe, so practical impact remains unconfirmed. At minimum, reject multiple matching notes before constructing the dictionary, so this unsupported case fails clearly rather than decoding with an arbitrary layout.
[suggestion] · USDT prerequisite check misses denied child tracing
When local ptrace policy denies GDB tracing its child, the USDT prerequisite check passes and the tests fail during node startup instead of skipping.
Location: test/functional/test_framework/test_framework.py:1025 (head).
Details and suggested fix
With Linux, compiled tracepoints, GDB and readelf available, skip_if_no_usdt_tools() runs only debugger commands that need no inferior. A sandbox or ptrace policy can therefore pass this check while preventing the GDB wrapper from launching bitcoind; wait_for_rpc_connection() then reports FailedToStartError. The documentation states the child-tracing requirement, and CI grants SYS_PTRACE, but the prerequisite check does not detect its absence locally. Add a preflight that runs a trivial child under GDB, such as gdb -nx --batch --return-child-result -ex run --args true, and skip with a tracing-permission diagnostic when that fails. No affected developer environment was identified, so practical impact remains unconfirmed.