10000 contrib: tracing: Fix read of `pmsg_type` in p2p_monitor.py by davidgumberg · Pull Request #32771 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

contrib: tracing: Fix read of pmsg_type in p2p_monitor.py #32771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

davidgumberg
Copy link
Contributor

This fixes a bug in the contrib tracing script p2p_monitor.py. currently the script fails to read the msg_type of inbound and outbound messages, which is useful in the per-peer message view.

Screenshot of p2p_monitor.py on master

Screenshot From 2025-06-18 11-37-43

Screenshot of p2p_monitor.py on this branch

Screenshot From 2025-06-18 11-41-38

@DrahtBot
Copy link
Contributor
DrahtBot commented Jun 18, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32771.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK janb84, 0xB10C, yuvicc

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@fanquake fanquake requested a review from 0xB10C June 18, 2025 19:14
Copy link
Contributor
@janb84 janb84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ut ACK 3473986

This PR fixes bug not displaying msg_type.
bpf_probe_read_user_str(&msg.msg_type, sizeof(msg.msg_type), pmsg_type tries to copy pmsg_type into kernel space but pmsg_type was still NULL (unassigned). This PR changes bpf_usdt_readarg to copy argument 4 to pmsg_type fixing the bug.

Steps taken in this review:

  • git blame (history of bug) ✅
  • code review ✅

Copy link
Contributor
@0xB10C 0xB10C left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3473986

Changes look good to me, but I haven't tested them yet.

Introduced by me in ec47ba3

@yuvicc
Copy link
Contributor
yuvicc commented Jun 20, 2025

Concept ACK

It would be good to have the message type with the size of message in p2p_monitor.py

@yuvicc
Copy link
Contributor
yuvicc commented Jun 20, 2025

ACK 3473986

Testing

On master

Screenshot

Screenshot from 2025-06-21 02-21-57

commit 3473986

Screenshot

Screenshot from 2025-06-21 02-31-21

@fanquake fanquake merged commit c584966 into bitcoin:master Jun 23, 2025
19 checks passed
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Jun 23, 2025
@fanquake
Copy link
Member

Backported to 29.x in #32589.

@fanquake fanquake mentioned this pull request Jun 23, 2025
fanquake added a commit that referenced this pull request Jun 25, 2025
0922f6b doc: update release notes for 29.x (fanquake)
5697605 contrib: tracing: Correctly read msg type in p2p_monitor.py (David Gumberg)
4c7ed36 test: Fix list index out of range error in feature_bip68_sequence.py (zaidmstrr)
3e23b47 doc: fix transifex 404s (fanquake)
616baf3 doc: taproot became always active in v24.0 (Sjors Provoost)
ef6111b depends: capnp 1.2.0 (fanquake)
8246c6a test: wallet, coverage for crash on dup block disconnection during unclean shutdown (Martin Zumsande)
a18085a wallet: fix crash on double block disconnection (furszy)
7264459 build: patch cmake min version on freetype (josibake)
27c5330 doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" (Hodlinator)
1b51d75 depends: fix SHA256SUM command on OpenBSD (use GNU mode output) (Sebastian Falbesoner)
aea8a39 doc: make `-DWITH_ZMQ=ON` explicit on `build-unix.md` (Luis Schwab)
23e76ef guix: warn and abort when SOURCE_DATE_EPOCH is set (will)
876a7b2 doc: add missing packages for BSDs (cmake, gmake, curl) to depends/README.md (Sebastian Falbesoner)
78688c8 rpc, doc: update `listdescriptors` RCP help (rkrux)
c899334 rpc: Note in fundrawtransaction doc, fee rate is for package (benthecarman)
247ee59 doc: update tor docs to use bitcoind binary from path (ismaelsadeeq)
4a1143b depends: use "mkdir -p" when installing xproto (fanquake)
646fa1d test: fix sync function in rpc_psbt.py (Martin Zumsande)
17b31fc doc: Add missing top-level description to pruneblockchain RPC (nervana21)
e34b6fb guix: accomodate migration to codeberg (fanquake)
142153e cmake: Add missed `SSE41_CXXFLAGS` (Hennadii Stepanov)

Pull request description:

  Backports
  - #31757
  - #32333
  - #32439
  - #32551 (just 800b7cc)
  - #32568
  - #32607
  - #32630
  - #32678
  - #32679
  - #32690 (just 8713e80)
  - #32693
  - #32696
  - #32708
  - #32711
  - #32719
  - #32760
  - #32765
  - #32771
  - #32776
  - #32777

  Closes #32625.

ACKs for top commit:
  instagibbs:
     ACK 0922f6b
  willcl-ark:
    ACK 0922f6b

Tree-SHA512: 0389e5d85fa897fdbefd37635f6ec822ca5ab48a57c4d40fdd4d1be2465c676f514b0db4d72c962ee15e0090b27ff17701e167d660eaa25f855d06bbb1fe0e6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0