Products › lamco-dbus-tools › Docs

Time a D-Bus call at the caller, at the bus and at each socket

Time a D-Bus call at the caller, at the bus and at each socket: Repeat it for a distribution, set a CI limit, join both ends and split it with the kernel part.

Describes version 0.4.1.

Needs dbusdo, a bus this user can connect to, and the service. Layer 4 or 5: A call is a real call, and it can start a service that wasn't running.

One call

$ dbusdo call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner s org.freedesktop.DBus
[org.freedesktop.DBus]
answered in 150.17 µs at the caller

A call takes the destination, the path and the method, written interface.member, then the arguments as busctl call takes them: A signature, then the values. Arrays take a count first (as 2 a b), dictionaries a count then pairs (a{sv} 1 key s value), a variant its type then its value (v i 3), and a structure its fields ((si) x 1). File descriptors (h) can't be given on a command line.

The figure is at the caller: From just before the call was sent to just after its answer was read. It holds both trips across the socket as well as the bus's and the service's work.

--no-auto-start sends the call with the flag that forbids starting a service, so a name nobody owns is an error instead of a start. --timeout <seconds> is how long to wait for each answer, 25 by default.

Repeated, for a distribution

$ dbusdo --out acts.json call --repeat 500 org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetId
500 calls, 500 answered, 0 not with a reply. At the caller: min 36.24 µs, median 47.02 µs, 95th 69.02 µs, 99th 85.7 µs, max 488.37 µs

The calls go one after another. --interval <seconds> waits between them. The call options come right after call, before the destination.

--out acts.json writes each call as an act: The caller's unique name, the call's serial, how it ended, the answer, and the two stamps. --out is a flag of dbusdo and goes before the chain.

A limit, for CI

dbusdo call --repeat 500 --max-p99 10 com.example.Catalog /com/example/Catalog com.example.Catalog.Lookup s widget
dbustell timing rec.json --max-p99 10 --junit timing.xml

--max-p99 <ms> fails the call, and so the run, when the 99th percentile at the caller is over the limit. dbustell timing --max-p99 checks each group of a recording the same way, at the bus, lists those over it and exits 1 when any is; --junit writes one case for each group. The percentile is the nearest rank: Of 500 calls the 495th, with fewer than 100 the slowest. A regression caught in CI has a job catching a regression the median doesn't show.

Both ends of the same calls

Record beside the calls, then join the two:

$ dbussee --quiet record --all --duration 4 --out rec.json &
$ dbusdo --out acts.json call --repeat 500 org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetId
$ wait
$ dbustell timing rec.json --caller acts.json
500 of the caller's 500 calls are in the recording, joined by the caller's name and the call's serial. On one machine's monotonic clock:
  At the caller          min  36.24 µs  median  47.02 µs  95th  69.02 µs  99th   85.7 µs  max 488.37 µs
  At the bus             min    290 ns  median   3.01 µs  95th   4.71 µs  99th   7.27 µs  max  30.46 µs
  Both trips together    min  12.72 µs  median  43.96 µs  95th  64.25 µs  99th  83.63 µs  max  486.3 µs

At the caller is from sending the call to reading its answer; at the bus, from the bus passing the call on to it passing the answer on, as the recorder saw them, each good to ± 30.46 µs. Both trips together are the first less the second: The call's way to the bus and the answer's way back.
The distributions agree: At each percentile, minimum to the 95th, the span at the bus is no longer than at the caller, within that. A percentile is judged with at least ten calls above it, so a few late stamps can't decide it: The 99th needs 1,000 calls, these are 200. The maximum is one call, and any error on it is that call's.
How the trips split between the way out and the way back isn't known better than 48.42 µs: The recorder read some answers that long after the caller did, so its stamps run late by at least that.

What each line means:

  • At the caller is the caller's own figure.
  • At the bus is the recording's: The bus's queueing and the service's work, without the trips.
  • Both trips together is the first less the second, for each call.
  • They agree when the bus's figure is no longer than the caller's at each percentile from the minimum to the 99th, within the recording's stated uncertainty. When they don't, the recording or the caller isn't what you think it is.
  • Single calls over. A few calls can read longer at the bus than at the caller. The recorder stamps a message when its reader takes it, and a reader scheduled late for one of a call's two messages puts them too far apart. The report counts those calls and says by how much, as that call's error.
  • The way out and the way back aren't given apart, because the recorder's stamps run late by how late it read, which the same calls bound from below.

The two captures must be of one machine and one boot, or their clocks don't subtract, and the report says so instead of joining them. --json gives the same as a document, under legs.

Split at every socket

With the kernel-level part running (dbuskeep kernel), a recording made with --kernel holds the kernel's stamps at every socket each call crossed, and --split divides each call's time between the bus, the service, the sockets and the caller itself. Run on Debian 13 on 2026-12-01, 200 calls to a service on a private dbus-daemon 1.16.2 whose address is in $BUS (docs/measurements/stage-11/):

$ dbussee --quiet --address "$BUS" record --all --kernel --duration 4 --out rec.json &
$ dbusdo --address "$BUS" --out acts.json call --repeat 200 com.example.Echo /echo com.example.Echo.Say s x
$ wait
$ dbustell timing rec.json --caller acts.json --split
...
Split by the kernel's stamps at each socket: 200 of 200 calls followed through all eight.
    in the bus, both ways: median 53.85 µs, 95th 72.2 µs, max 91.29 µs
    in the service: median 30.89 µs, 95th 43.32 µs, max 113.87 µs
    across the four sockets: median 63.52 µs, 95th 95.34 µs, max 193.85 µs
    the caller's own time: median 17.94 µs, 95th 28.15 µs, max 123.5 µs
    the caller's figure: median 171.84 µs, 95th 238.28 µs, max 380.23 µs
  Each gap:
      caller to bus: median 16.48 µs, 95th 30.52 µs, max 121.51 µs
      in the bus, the call: median 22.59 µs, 95th 37.12 µs, max 57.15 µs
      bus to service: median 12.17 µs, 95th 26.12 µs, max 55.43 µs
      in the service: median 30.89 µs, 95th 43.32 µs, max 113.87 µs
      service to bus: median 16.65 µs, 95th 38.66 µs, max 141.41 µs
      in the bus, the answer: median 24.88 µs, 95th 42.58 µs, max 47.62 µs
      bus to caller: median 14.76 µs, 95th 26.16 µs, max 54.64 µs
  Every call's eight stamps lie inside its span at the caller, which sums its own time and the kernel's span. A gap from a write to its read is known to within that write's length, at most 22.6 µs here.

What each line means:

  • In the bus, both ways is the bus's own time: From reading the call to writing it to the service, and from reading the answer to writing it to the caller.
  • In the service is from the service reading the call to it writing the answer.
  • Across the four sockets is each message's wait from one end's write to the other end's read, which is mostly the reader being woken and scheduled.
  • The caller's own time is the caller's figure less the kernel's span: Building the call before its write and handling the answer after its read.
  • Every call's stamps lie inside its span at the caller, or the call isn't shown and is counted as joined wrongly.

--split exits 1 when the recording hasn't the kernel's stamps. --json gives each call's seven gaps under split.

What can go wrong

  • call fails, and dbusdo exits 1, when the answer is an error or doesn't come in time. soft call lets the chain go on.
  • A call to a service that asks a person for permission can raise a dialog, and its figure then holds the person.
  • 0 of the caller's 500 calls are in the recording: The recording didn't cover the calls, or listened to something else. Record with --all, or --service naming the destination, and start it first.

docs/measurements/stage-6/README.md has the measurements behind these figures.