Member-only story

DevOps in Linux — biosnoop Command

Deep dive into Linux biosnoop command

Tony
3 min readMay 22, 2023

Note, full mind map is available at: “DevOps in Linux Mind Map

What is biosnoop

The biosnoop command in Linux is a BCC (BPF Compiler Collection) tool that traces block device I/O (input/output) and provides latency information for each operation. It is a powerful tool for monitoring disk I/O performance, especially useful for identifying slow I/O operations or bottlenecks.

biosnoop uses eBPF (extended Berkeley Packet Filter) technology, which allows for efficient and safe tracing of kernel events without the need for custom kernel modules. Its source code can be found in the BCC GitHub repository.

https://github.com/iovisor/bcc/blob/master/tools/biosnoop.py

This file is a Python script that uses the BCC library to compile and attach eBPF programs to trace block device I/O events. The script collects and processes the traced data, presenting it in a human-readable format. The main components of the script include the eBPF program (written in C), and the Python code that loads the eBPF program, attaches the probes, and displays the output.

biosnoop Sample Output

--

--

Tony
Tony

Responses (1)