Products › lamco-dbus-tools › Docs

What lamco-dbus-tools is: D-Bus debugging and auditing

What lamco-dbus-tools is: Five programs for D-Bus debugging and auditing that record bus traffic, time calls, find stuck calls and read policy and sandboxes.

Describes version 0.4.1. The README lists every command and what it does.

D-Bus is how programs on a Linux machine talk to each other: The desktop to its settings, an application to the network service, a sandboxed program to the portal that opens a file for it. When it works nobody thinks about it. When it doesn't, the symptom is somewhere else: A window that takes 25 seconds to open, a login that hangs, a setting that won't save, "access denied" with no reason given.

lamco-dbus-tools is a toolkit for finding out what happened on a bus, and what a bus allows.

What it does

  • Records what crosses a bus, timing each message on a named clock, and without endangering the bus.
  • Measures how long calls take, as distributions for each method, at the caller and at the bus, and with the kernel part, divided between the bus, the service and the sockets between them.
  • Finds what's stuck: Calls that never got a reply, and the chains of programs waiting on each other.
  • Explains starts and refusals: How long a service took to start, why one didn't, why a message was refused.
  • Audits what a machine's bus policy allows, service by service, and what changed since last time.
  • Reads sandboxes: What each sandboxed application may reach, and whether the sandbox does what its grant says.
  • Holds a service to its interface: Every change between two versions of an interface, as breaking or not, for a service's own CI.
  • Reports in the forms other tools read: JUnit for CI, SARIF for code scanning, pcapng for Wireshark.

The programs

Program What it's for
dbussee Watches and reads. It contains no command that starts or changes anything, so it's safe to run for a bug report or on a production machine
dbusdo Drives: Timed calls, starting services, replaying a recording, running one program under observation. Everything it does is recorded
dbustell Analyzes a stored recording. It needs no bus, so it runs anywhere
dbuskeep An optional background service that keeps the last minutes of a bus with one monitor for every reader, and loads the kernel part. Nothing requires it
dbussee-monitor A small helper that lets the members of one group record the system bus without root

What it isn't

  • Not a browser of services. It doesn't offer a graphical or terminal browser of a bus's services.
  • Not a graphical viewer. Its recordings can be exported to pcapng, which Wireshark opens.
  • Not a test double. Mocking a service is a mock-service library's job.
  • Not specific to any service. It knows what a message, a name, a policy rule and a grant are. What the portal or the display service means is the business of lamco-dsi-tools, which shares its recording format and its clock, so the two toolkits' recordings of one machine line up.

Why another tool

The tools that exist record traffic and stop there. In the research behind this toolkit, none of them reported which call was waiting on whom, gave call times as a distribution, timed a service's start, said which rule refused a message, compared two recordings, or wrote a scrubbed capture for a bug report. None protected the bus from itself.