Skip to content

Want vsock packet dtrace probes#1100

Merged
papertigers merged 1 commit intomasterfrom
spr/papertigers/want-vsock-packet-dtrace-probes
Apr 3, 2026
Merged

Want vsock packet dtrace probes#1100
papertigers merged 1 commit intomasterfrom
spr/papertigers/want-vsock-packet-dtrace-probes

Conversation

@papertigers
Copy link
Copy Markdown
Contributor

@papertigers papertigers commented Apr 2, 2026

We want the ability to trace packet flows from guest<-->host.

❯ pfexec dtrace -Zqn 'propolis*:::vsock_pkt_* {printf("%s\n\n", json(copyinstr(arg0), "ok"));}'  | jq
{
  "src_cid": 16,
  "dst_cid": 2,
  "src_port": 3308370434,
  "dst_port": 2222,
  "len": 0,
  "socket_type": "Stream",
  "op": "Request",
  "flags": "",
  "buf_alloc": 262144,
  "fwd_cnt": 0
}
{
  "src_cid": 2,
  "dst_cid": 16,
  "src_port": 2222,
  "dst_port": 3308370434,
  "len": 0,
  "socket_type": "Stream",
  "op": "Response",
  "flags": "",
  "buf_alloc": 131072,
  "fwd_cnt": 0
}
{
  "src_cid": 16,
  "dst_cid": 2,
  "src_port": 3308370434,
  "dst_port": 2222,
  "len": 22,
  "socket_type": "Stream",
  "op": "ReadWrite",
  "flags": "",
  "buf_alloc": 262144,
  "fwd_cnt": 0
}
{
  "src_cid": 2,
  "dst_cid": 16,
  "src_port": 2222,
  "dst_port": 3308370434,
  "len": 22,
  "socket_type": "Stream",
  "op": "ReadWrite",
  "flags": "",
  "buf_alloc": 131072,
  "fwd_cnt": 22
}
{
  "src_cid": 16,
  "dst_cid": 2,
  "src_port": 3308370434,
  "dst_port": 2222,
  "len": 0,
  "socket_type": "Stream",
  "op": "CreditUpdate",
  "flags": "",
  "buf_alloc": 262144,
  "fwd_cnt": 22
}
..... snip ......
{
  "src_cid": 16,
  "dst_cid": 2,
  "src_port": 3308370434,
  "dst_port": 2222,
  "len": 96,
  "socket_type": "Stream",
  "op": "ReadWrite",
  "flags": "",
  "buf_alloc": 262144,
  "fwd_cnt": 5278
}
{
  "src_cid": 16,
  "dst_cid": 2,
  "src_port": 3308370434,
  "dst_port": 2222,
  "len": 0,
  "socket_type": "Stream",
  "op": "Shutdown",
  "flags": "VIRTIO_VSOCK_SHUTDOWN_F_SEND",
  "buf_alloc": 262144,
  "fwd_cnt": 5278
}
{
  "src_cid": 16,
  "dst_cid": 2,
  "src_port": 3308370434,
  "dst_port": 2222,
  "len": 0,
  "socket_type": "Stream",
  "op": "Shutdown",
  "flags": "VIRTIO_VSOCK_SHUTDOWN_F_RECEIVE | VIRTIO_VSOCK_SHUTDOWN_F_SEND",
  "buf_alloc": 262144,
  "fwd_cnt": 5278
}
{
  "src_cid": 2,
  "dst_cid": 16,
  "src_port": 2222,
  "dst_port": 3308370434,
  "len": 0,
  "socket_type": "Stream",
  "op": "Reset",
  "flags": "",
  "buf_alloc": 131072,
  "fwd_cnt": 0
}
{
  "src_cid": 16,
  "dst_cid": 2,
  "src_port": 3308370434,
  "dst_port": 2222,
  "len": 0,
  "socket_type": "Stream",
  "op": "Reset",
  "flags": "",
  "buf_alloc": 262144,
  "fwd_cnt": 5278
}

Created using jj-spr 0.1.0
@papertigers papertigers requested a review from iximeow April 2, 2026 17:44
Copy link
Copy Markdown
Member

@iximeow iximeow left a comment

Choose a reason for hiding this comment

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

easy signoff :) the json stuff in dtrace is neat!

@papertigers papertigers merged commit b318418 into master Apr 3, 2026
12 checks passed
@papertigers papertigers deleted the spr/papertigers/want-vsock-packet-dtrace-probes branch April 3, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants