Products › lamco-dbus-tools › Docs
D-Bus call timing: What each figure measures, and where
D-Bus call timing explained: Why a message carries no time, what a figure at the bus or at the caller holds, and what a split at each socket adds.
Describes version 0.4.1, with measurements made from 2026-11-27 to 12-01 of both ends of a call and of the kernel part.
A message carries no time
Nothing in a D-Bus message says when it was sent. Every time in every D-Bus tool is the observer's own reading of its own clock, taken when the observer got around to reading the message.
lamco-dbus-tools says so in each record: A message record has one stamp, the instrument's arrival, and the record states that the protocol gave none.
Which clock
Every existing tool but one stamps wall-clock time. Wall-clock time can jump, and two recordings can't be lined up by it with any confidence.
The toolkit stamps on the monotonic clock and writes into each recording which machine and which boot that clock belongs to. Two recordings are compared only when both match. This is the rule of lamco-dsi-tools, and it's why a D-Bus recording and a desktop recording of one machine can be read side by side.
What a duration means
A call and its reply are paired exactly: The caller's name and serial number on the call, and the same serial number named on the reply. No guessing is involved.
The time between them, as a monitor sees it, runs from "the bus passed on the call" to "the bus passed on the reply". It contains the bus's own queueing, the service waking up, the service working, and the service sending. A monitor can't separate those. Measured on a private bus, one trivial call took 211 microseconds at the bus, as the monitor saw it, and 242 at the caller.
So each figure names what it spans, and a figure taken at the caller is never pooled with one taken at the bus.
Both ends of one call
dbusdo call stamps a call just before sending it and just after reading its answer. A recording beside it
stamps the bus passing each on. On one machine and boot the four are readings of one clock, and
dbustell timing --caller joins them by the caller's name and the call's serial.
What they showed (docs/measurements/stage-6/README.md):
- The two figures agree as distributions. At each percentile from the minimum to the 99th, the bus's figure was no longer than the caller's, within the recording's stated uncertainty, in twenty runs on the two bus implementations. For a call the bus answers itself, nearly all of the caller's figure is the two trips across the socket: 47 µs at the caller and 3 µs at the bus, at the median.
- A single call's figure at the bus can be off by much more than the floor. In those runs 0 to 5 calls of 200 read longer at the bus than at the caller, by up to 0.89 ms, which can't be true. The recorder stamps a message when its reader takes it, after the bus has passed it on, and a reader scheduled late for one of a call's two messages puts them too far apart. So a distribution is trustworthy where one call isn't, and the report counts the calls that can't be right instead of hiding them.
- The way out and the way back can't be told apart by a monitor. Its stamps run late by however late it read, which the same calls bound from below: In one run the recorder read some answers 48 µs after the caller had. The report gives both trips together, and says why it gives no more.
The relay gives a third figure: From the relay reading a call off the program's socket to it reading the answer from the bus. It's within a hop of the program's own moments, and it's named apart from both.
The floor
When the bus answers a call itself, the call and the reply arrive at the monitor in one read and are stamped 4 microseconds apart, whatever the true gap was. The kernel offers no receive time for the kind of socket D-Bus uses. Short durations therefore carry a stated uncertainty, and a distribution's line gives the floor.
Distributions
One value hides the stalls that matter. Every call time, at the bus or at the caller, is reported as a count, a minimum, a median, the 95th and 99th percentiles and a maximum.
Other clocks that line up
The journal stamps each line with a monotonic time, and the service manager records when each unit started on the same clock. A recording on that clock can be subtracted from them directly, which is how the toolkit times a service's start: From the request on the bus, to the unit starting, to the name appearing.
What only the kernel can add
Splitting time in the bus from time in the service needs a stamp at each socket a call crosses. The kernel
part takes them: Hooks at the start and end of every write to and read from a bus's socket, eight stamps for
a call and its answer, on the one clock the other figures use. dbustell timing --caller --split divides each
call into the seven gaps between them: Across the caller's socket, in the bus, across the service's socket, in
the service, back across its socket, in the bus again, and back across the caller's.
What it showed (docs/measurements/stage-11/README.md), for 200 calls to a service on a private bus, on four
machines: Every call followed through all eight stamps, the seven gaps summing exactly to the kernel's span
and the caller's own time to the caller's figure, no call outside it. At the median on Debian 13, split at each socket, of the
caller's 171.8 µs, 53.9 µs was in the bus both ways, 30.9 µs in the service, and 63.5 µs crossing the four
sockets. Each gap from a write to its read is known to within that write's own length, at most 22.6 µs there.
It isn't free: Every stream socket on the machine passes the hooks while they're loaded, and the cost to one that isn't a bus's is measured and stated with them.
Waiting on a person
A call that sits behind a password prompt took a person's time, not the service's. Such waits are kept apart from working time.