virtiostat(8)

πŸŽ€ virtiostat πŸŽ€

πŸ¦‹ NAME

okay so virtiostat is a tracer for VIRTIO devices' input/output statistics πŸ’… It uses Linux eBPF/bcc, so it's basically built on bcc πŸ”₯

✨ SYNOPSIS ✨

virtiostat [-h] [-T] [-D] [-d DRIVER] [-n DEVNAME] [INTERVAL] [COUNT]

πŸ’– DESCRIPTION

bestie, this tool traces input/output statistics for VIRTIO devices 🌸 It works in the lower layer of the VIRTIO base driver, so it can trace every device in the VIRTIO family ✨ Like, we can't see the IO stats of 9p-fs in a guest virtual machine with the iostat command, but virtiostat can analyze them, no cap πŸ™ˆ

The output shows In/Out SGs (scatter list operations) to represent positive correlation IOPS, and In/Out BW to represent throughput πŸ“ˆ So the SGs are the vibe for IOPS and the BW is the vibe for throughput 🫢

πŸ”’ Since this uses BPF, only the root user can use this tool. No root, no tracing, periodt πŸ’€

🌈 REQUIREMENTS

You need CONFIG_BPF and bcc 🧚

πŸŽ€ OPTIONS

  • -h β€” prints the usage message πŸ’…
  • -T β€” adds a time column to the output, formatted as HH:MM:SS ⏰
  • -D β€” shows debug info for the bpf text πŸ™ˆ
  • -d DRIVER β€” filters by driver name πŸ¦‹
  • -n DEVNAME β€” filters by device name πŸ“
  • INTERVAL β€” prints output every INTERVAL seconds ✨
  • COUNT β€” the total count of the trace, in seconds πŸ”₯

🧚 EXAMPLES

Trace virtio device stats and print 1 second summaries, 10 times πŸ’œ

# virtiostat 1 10

Trace virtio block devices only 🌸

# virtiostat -d virtio_blk

⚑ OVERHEAD

This one traces the kernel virtqueue_add_sgs, virtqueue_add_outbuf, virtqueue_add_inbuf, and virtqueue_add_inbuf_ctx functions πŸ‘€ How much overhead you get depends on the IOPS of all the VIRTIO devices, so it can get a little intense 😭

🌷 SOURCE

This is from bcc 🌈 The link is:

https://github.com/iovisor/bcc

Also look in the bcc distribution for a companion _examples.txt file, which has example usage, output, and commentary for this tool πŸ“š

πŸ’» OS

Linux 🐧

πŸ§ͺ STABILITY

Unstable - in development. 🚧 Be gentle with it, it's still cooking 🍳

πŸ‘‘ AUTHOR

zhenwei pi πŸ’œ

πŸ”— SEE ALSO

iostat(1), iftop(8), funccount(8) 🫢


Footer check πŸŽ€ this page lives in the USER COMMANDS section and was last updated 2021-02-15, so it's giving fresh but still classic πŸ’… Love you, bestie, and go trace some VIRTIO βœ¨πŸ¦‹