systool: Inspect System Device Information by Bus and Class


systool: Inspect System Device Information by Bus and Class

systool is a Linux utility from the sysfs package that lets you view attributes of devices grouped by bus (like pci or usb) or by class. It’s especially handy when you want to peek at device details without digging through /sys manually.

Quick start: what you can do

  • List all attributes for devices on a bus: view details across all devices on that bus.
  • List all attributes for a device class: view details for a class of devices.
  • Show only device drivers for a bus: quickly identify which drivers are bound to devices on that bus.

Typical commands:

# Show all attributes for all PCI devices
systool -b pci -v

# Show all attributes for all USB devices
systool -b usb -v

# Show attributes for a device class (e.g., drm)
systool -c drm -v

# Show only device drivers of a bus (e.g., PCI)
systool -b pci -D

This tool is part of the sysfs package and relies on information exposed by /sys. If you don’t see expected output, you might be missing permissions or the relevant bus/class in your kernel.

When to use systool

  • Quick audits: see driver names, versions, and attributes attached to devices.
  • Debugging: verify which devices are bound to which drivers.
  • Learning: explore how devices are organized by bus or class in the kernel.

How to use by bus

  • List all attributes for a bus (with verbose output):
systool -b pci -v
  • Replace pci with other buses you’re curious about, e.g., usb, mmc, pnp.
  • If you want to focus on what drives are attached, add -D:
systool -b usb -D

Common pitfalls:

  • Permissions: systool often requires root to see all attributes. Run with sudo if needed.
  • Incomplete /sys: some virtual or not-present devices may not show full data depending on kernel config.

How to use by class

  • List attributes for a class (e.g., drm):
systool -c drm -v
  • This is useful to inspect class-wide properties like bounds, possible bindings, or driver info.

Quick checks with ls

If you’re exploring, you might first list the accessible buses or classes:

ls /sys/bus
ls /sys/class

Then pick a name from the listing and inspect with systool:

systool -b somebus -v

Output sanity checks

  • Expected fields: name, class, vendor, device, driver, and other bus/class specific attributes.
  • If you don’t see driver names, it might be because binding isn’t present yet or the device isn’t bound to a driver.

Common pitfalls

  • Misidentifying the bus/class: PCI versus USB devices look different across systems; make sure you’re querying the right one.
  • Overwhelming output: use -v for verbose attributes, or filter by -D to focus on drivers.
  • No data for some devices: some devices expose limited attributes in sysfs depending on kernel support.

Troubleshooting tips

  • Check permissions: sudo systool -b pci -v if you’re not seeing expected data.
  • Verify sysfs presence: ensure /sys is mounted with sysfs and that the bus/class exists on your hardware.
  • Kernel/module state: to see drivers, ensure the module is loaded and the device is bound.

Wrap up

systool is a lightweight, targeted way to peek at how devices are organized by bus or class and to spot driver associations quickly. Start with a high-level -v view and drill down into -D when you need driver-specific details.

See Also