{
 "number": 36627,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36627",
 "title": "tracing: run USDT tests without BPF privileges",
 "author": "willcl-ark",
 "author_association": "MEMBER",
 "created_at": "2026-10-23T16:08:24Z",
 "updated_at": "2026-10-26T10:43:36Z",
 "description_hash": "b59d02f514db930f",
 "age_days": 9,
 "draft": false,
 "labels": [],
 "milestone": null,
 "base": "master",
 "head_sha": "e0ef6fd65ab28572eb52684b2833d3ec2fcfdb27",
 "head_ref": "tracing-no-sudo",
 "head_repo": "willcl-ark/bitcoin",
 "head_history": [],
 "additions": 413,
 "deletions": 1073,
 "changed_files": 12,
 "commit_count": 2,
 "size_bucket": "XL",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "concept_ack": [
     {
      "login": "fanquake",
      "url": "https://github.com/bitcoin/bitcoin/pull/36627#issuecomment-6369364243"
     },
     {
      "login": "0xB10C",
      "url": "https://github.com/bitcoin/bitcoin/pull/36627#issuecomment-6373632789"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "fanquake": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-10-23T16:13:14Z",
   "stale": false
  },
  "0xB10C": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-10-23T20:02:16Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 2,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "0xB10C",
   "fanquake",
   "maflcko"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-23T19:32:51Z",
  "last_reviewer_activity": "2026-10-26T10:43:36Z",
  "last_reviewer": "maflcko",
  "author_silent_days": 9,
  "waiting_on_author_days": 6,
  "days_since_update": 6
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  ".github/workflows/ci.yml",
  "ci/test/00_setup_env_native_asan.sh"
 ],
 "body": "The USDT functional tests currently use BCC to attach eBPF programs to Bitcoin Core\u2019s tracepoints. This requires BCC, matching kernel headers, and elevated BPF permissions, making the tests awkward to run locally and\nrequiring a privileged container in CI.\n\nReplace 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\nthe parts of the USDT interface provided by Bitcoin Core:\n\n- the probe metadata is present and understood;\n- the probes can be enabled and are reached in the expected scenarios; and\n- their arguments have the expected values, sizes, and lifetimes.\n\nAll 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\nthe tests, reducing their size and maintenance burden. Overall, the change removes roughly 660 lines of test and CI code.\n\n#### Tradeoffs\n\n- 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\n  those components would no longer be detected here.\n- LeakSanitizer is disabled for nodes run under GDB because it cannot operate under `ptrace`. Other sanitizer checks remain enabled.\n\nThe remaining coverage is focused on Bitcoin Core\u2019s side of the USDT interface. Testing the general BCC, eBPF, and kernel uprobe is left to those consumers and the kernel.",
 "commits": [
  {
   "sha": "03d302c2c6aea1cee57025b6c37364292fac4d89",
   "date": "2026-10-23T15:47:43Z",
   "message": "test: Capture USDT probes with GDB\n\nLaunch traced nodes as GDB children so the existing probe scenarios can\nrun without BCC, BPF privileges, or matching host kernel headers.\n\n- Copy probe arguments while stopped and drain complete records in the\n  test process, including events emitted during node shutdown and\n  restart.\n- Follow the bitcoin launcher through exec before registering probes.\n- Handle a GDB parser failure for GCC byte-register operands in usdt.py.\n- Disable LeakSanitizer only for traced children because it cannot\n  operate under ptrace; keep other sanitizer checks remain enabled."
  },
  {
   "sha": "e0ef6fd65ab28572eb52684b2833d3ec2fcfdb27",
   "date": "2026-10-23T15:51:00Z",
   "message": "ci: Run tracing tests without BPF dependencies\n\nThe USDT tests now launch nodes under GDB, so the ASan job no longer needs\nBCC, matching host kernel headers, or a privileged container. Install GDB\nand binutils and retain SYS_PTRACE for debugger and sanitizer operation.\nRemove the host-kernel package refresh and BCC workflow toggle along with\nthe dependencies they supported."
  }
 ],
 "timeline": [
  {
   "t": "2026-10-23T16:13:14Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "Concept ACK",
   "id": "c:6369364243",
   "url": "https://github.com/bitcoin/bitcoin/pull/36627#issuecomment-6369364243",
   "hash": "e8334cc43879b73c",
   "edited": null
  },
  {
   "t": "2026-10-23T16:13:26Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "cc @0xB10C",
   "id": "c:6369368188",
   "url": "https://github.com/bitcoin/bitcoin/pull/36627#issuecomment-6369368188",
   "hash": "e4fd7acae9ba3c34",
   "edited": null
  },
  {
   "t": "2026-10-23T19:32:51Z",
   "kind": "comment",
   "who": "willcl-ark",
   "assoc": "MEMBER",
   "text": "I beefed up the tradeoffs section here as I think it may have been undersold in its previous form.",
   "id": "c:6373122978",
   "url": "https://github.com/bitcoin/bitcoin/pull/36627#issuecomment-6373122978",
   "hash": "d954c6b47d94e7c8",
   "edited": null
  },
  {
   "t": "2026-10-23T20:02:16Z",
   "kind": "comment",
   "who": "0xB10C",
   "assoc": "MEMBER",
   "text": "Concept ACK.\n\nNice, 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.\n\nDoes this also make the tests work aarch64 ref https://github.com/bitcoin/bitcoin/issues/35142#issuecomment-4959156870?",
   "id": "c:6373632789",
   "url": "https://github.com/bitcoin/bitcoin/pull/36627#issuecomment-6373632789",
   "hash": "422606dc8f7c82fd",
   "edited": "2026-10-23T20:02:35Z"
  },
  {
   "t": "2026-10-26T10:41:31Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": ".github/workflows/ci.yml",
   "commit": "e0ef6fd65ab28572eb52684b2833d3ec2fcfdb27",
   "in_reply_to": null,
   "text": "remove the comment?",
   "id": "rc:4376326934",
   "url": "https://github.com/bitcoin/bitcoin/pull/36627#discussion_r4376326934",
   "hash": "31531f48d219da12",
   "edited": "2026-10-26T10:43:36Z"
  },
  {
   "t": "2026-10-26T10:41:43Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "ci/test/00_setup_env_native_asan.sh",
   "commit": "e0ef6fd65ab28572eb52684b2833d3ec2fcfdb27",
   "in_reply_to": null,
   "text": "bump, like all other sanitizer tests?",
   "id": "rc:4376328538",
   "url": "https://github.com/bitcoin/bitcoin/pull/36627#discussion_r4376328538",
   "hash": "5cd9d7c5101cab58",
   "edited": "2026-10-26T10:43:53Z"
  },
  {
   "t": "2026-10-26T10:43:36Z",
   "kind": "review",
   "who": "maflcko",
   "assoc": "MEMBER",
   "state": "COMMENTED",
   "commit": "e0ef6fd65ab28572eb52684b2833d3ec2fcfdb27",
   "text": "How does this fit into the large picture in https://github.com/bitcoin/bitcoin/issues/35142  ?",
   "id": "r:5650761537",
   "url": "https://github.com/bitcoin/bitcoin/pull/36627#pullrequestreview-5650761537",
   "hash": "171c21f6c57600e6",
   "edited": null
  }
 ],
 "labels_log": [],
 "state_log": [],
 "text_chars": 3325,
 "text_tokens_estimate": 831,
 "changed_paths": [
  ".github/workflows/ci.yml",
  "ci/test/00_setup_env_native_asan.sh",
  "ci/test/03_test_script.sh",
  "doc/tracing.md",
  "test/functional/interface_usdt_coinselection.py",
  "test/functional/interface_usdt_mempool.py",
  "test/functional/interface_usdt_net.py",
  "test/functional/interface_usdt_utxocache.py",
  "test/functional/interface_usdt_validation.py",
  "test/functional/test_framework/test_framework.py",
  "test/functional/test_framework/usdt.py",
  "test/functional/test_framework/util.py"
 ],
 "files": [
  {
   "path": ".github/workflows/ci.yml",
   "add": 0,
   "del": 6
  },
  {
   "path": "ci/test/00_setup_env_native_asan.sh",
   "add": 2,
   "del": 10
  },
  {
   "path": "ci/test/03_test_script.sh",
   "add": 0,
   "del": 8
  },
  {
   "path": "doc/tracing.md",
   "add": 18,
   "del": 0
  },
  {
   "path": "test/functional/interface_usdt_coinselection.py",
   "add": 60,
   "del": 145
  },
  {
   "path": "test/functional/interface_usdt_mempool.py",
   "add": 33,
   "del": 198
  },
  {
   "path": "test/functional/interface_usdt_net.py",
   "add": 76,
   "del": 362
  },
  {
   "path": "test/functional/interface_usdt_utxocache.py",
   "add": 55,
   "del": 245
  },
  {
   "path": "test/functional/interface_usdt_validation.py",
   "add": 14,
   "del": 80
  },
  {
   "path": "test/functional/test_framework/test_framework.py",
   "add": 11,
   "del": 12
  },
  {
   "path": "test/functional/test_framework/usdt.py",
   "add": 144,
   "del": 0
  },
  {
   "path": "test/functional/test_framework/util.py",
   "add": 0,
   "del": 7
  }
 ],
 "test_lines": 1462,
 "git": {
  "head": "e0ef6fd65ab28572eb52684b2833d3ec2fcfdb27",
  "head_matches_backup": true,
  "base": "df0dc1e2d2059213e49a9f115fd55a9f0119d26c",
  "patch_id": "96e2f6f569a9c008",
  "commits": [
   {
    "sha": "03d302c2c6",
    "subject": "test: Capture USDT probes with GDB",
    "files": 9,
    "add": 411,
    "del": 1049
   },
   {
    "sha": "e0ef6fd65a",
    "subject": "ci: Run tracing tests without BPF dependencies",
    "files": 3,
    "add": 2,
    "del": 24
   }
  ],
  "patch_truncated": true
 },
 "patch_id": "96e2f6f569a9c008",
 "input_hash": "428cc89db8cce19e",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}