test: USDT tracepoint interface tests
Summary:
This adds functional tests for the USDT tracepoints added in #22006 and #22902. This partially fixes #23296. The tests are probably skipped on most systems as these tests require: a Linux system with a kernel that supports BPF (and available kernel headers) that Bitcoin Core is compiled with tracepoints for USDT support (default when compiled with depends) bcc installed the tests are run with a privileged user that is able to e.g. do BPF syscalls and load BPF maps
Backport of core#24358 and core#25528 for the test fixes.
Depends on D12737.
Note that:
- We don't run it on CI (yet)
- We need to prune more blocks to trigger the expected flush event as our block files are smaller
- The 3 tests succeed on my machine, but the runner returns an error because I got compilation warnings that print to stderr
Test Plan:
With tracing enabled:
sudo ./test/functional/test_runner.py interface_usdt_net sudo ./test/functional/test_runner.py interface_usdt_utxocache sudo ./test/functional/test_runner.py interface_usdt_validation ninja check-functional
Check the tests are skipped as expected when not run as root.
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Subscribers: PiRK
Differential Revision: https://reviews.bitcoinabc.org/D12739