While Linux provides powerful tools like top and iotop to observe CPU and disk input/output, and iftop to track network bandwidth, identifying which connected Universal Serial Bus (USB) peripheral is consuming bus bandwidth has traditionally required complex packet captures using Wireshark and the usbmon kernel driver. In data acquisition rigs, multi-camera computer vision pipelines, external high-speed NVMe enclosures, and software-defined radio (SDR) arrays, saturated USB host controllers can trigger frame drops, buffer overruns, and device disconnects. The usbtop utility fills this diagnostic gap by providing an interactive terminal dashboard that reports real-time bandwidth utilisation, instantaneous data throughput, and transfer rates per USB bus and connected device.
Understanding usbtop and the Linux usbmon Subsystem
The Linux kernel features a built-in USB monitoring facility known as usbmon. When active, usbmon intercepts raw USB Request Blocks (URBs) as they pass between device drivers and the Host Controller Interface (xHCI, EHCI, or OHCI). usbtop taps into these kernel taps without interrupting active transfers, parsing bidirectional URB payloads to calculate:
- Bus-Level Bandwidth: The aggregate data volume transiting each physical USB bus root hub (e.g., Bus 1, Bus 2).
- Device-Level Throughput: Real-time read (IN) and write (OUT) throughput in kilobytes or megabytes per second for each connected peripheral address.
- Endpoint Traffic Breakdown: Detailed byte streams isolated by endpoint address (e.g., Isochronous endpoints for audio/video streams, Bulk endpoints for external drives, and Interrupt endpoints for HID input devices).
Installing usbtop and Prerequisites on Linux
The usbtop utility requires the usbmon kernel driver and libpcap headers. On major distributions, install the required packages or build via the distribution package manager:
# Ubuntu and Debian
sudo apt update && sudo apt install -y usbtop
# Fedora, RHEL, and Rocky Linux (via EPEL or source build)
sudo dnf install -y gcc-c++ cmake libpcap-devel libboost-dev
# Arch Linux
sudo pacman -S usbtop
Before launching usbtop, verify that the usbmon kernel module is loaded into the kernel ring buffer:
sudo modprobe usbmon
ls -l /sys/kernel/debug/usb/usbmon
If the debug directory returns permission errors, mount the debugfs filesystem:
sudo mount -t debugfs none_debugs /sys/kernel/debug
Listing Monitored USB Buses and Interfaces
Run usbtop with the --list flag to enumerate all available USB buses detected by the kernel:
sudo usbtop --list
The command lists the available usbmon tap devices:
Available interfaces:
usbmon0 (All USB buses combined)
usbmon1 (USB Bus 1)
usbmon2 (USB Bus 2)
usbmon3 (USB Bus 3)
The special interface usbmon0 captures traffic spanning all physical USB host controllers simultaneously.
Launching the Interactive Bandwidth Monitor
To launch the real-time top-like monitoring dashboard across all connected USB buses, run:
sudo usbtop
By default, usbtop binds to usbmon0, presenting a live updating terminal table:
Bus 01 Device 01: Host Controller
To device: 0.00 KiB/s
From device: 0.00 KiB/s
Bus 01 Device 03: High-Speed Web Camera
To device: 1.20 KiB/s
From device: 3845.50 KiB/s
Bus 02 Device 02: External NVMe SSD
To device: 42500.00 KiB/s
From device: 120.00 KiB/s
The display dynamically sorts peripherals by throughput, allowing you to instantly identify which device is monopolizing USB controller bandwidth.
Monitoring a Specific USB Host Controller
When diagnosing saturation on a specific root hub (for instance, isolating a PCIe add-in USB 3.2 card on Bus 2), instruct usbtop to capture only the specified interface:
sudo usbtop --interface usbmon2
Filtering and Isolating Specific USB Endpoints
To inspect bandwidth consumption at the granular endpoint level (distinguishing between control commands and streaming video feeds), enable detailed endpoint output:
sudo usbtop --show-endpoints
The output expands each device block to show individual endpoint identifiers:
Bus 01 Device 03: High-Speed Web Camera
Endpoint 0x81 (EP 1 IN - Isochronous): 3820.00 KiB/s
Endpoint 0x00 (EP 0 OUT - Control): 2.10 KiB/s
This level of detail enables embedded hardware developers to verify whether streaming video sensors adhere to designated USB 2.0 (480 Mbps) or USB 3.0 (5 Gbps) transfer envelopes.
Logging USB Bandwidth for Automated Performance Analysis
For automated benchmarking and system stress testing, execute usbtop in headless batch mode or pipe raw usbmon statistics to standard output:
# Capture raw usbmon text stream for automated parsing
sudo cat /sys/kernel/debug/usb/usbmon/0u | head -n 50
Utilizing usbtop transforms USB diagnostic troubleshooting in Linux, providing immediate, live insight into bus saturation, device transfer rates, and hardware bottleneck locations without intrusive profiling overhead.