Products › lamco-dbus-tools › Interfaces
org.freedesktop.DBus.Peer Ping: Is the service there at all
org.freedesktop.DBus.Peer Ping is the D-Bus call no service code answers, which lamco-dbus-tools uses to tell the time in the bus from the time in a service.
org.freedesktop.DBus.Peer is the smallest standard interface: Ping, which does nothing but reply, and GetMachineId, which says which machine a process runs on. Libraries answer both on a program's behalf, so a Ping asks whether a connection is alive and reading, without touching the service's own code. That makes it the call to reach for when a service seems slow and the question is whether the bus, the socket or the service is to blame. lamco-dbus-tools records it like any call, sends it on purpose with dbusdo call, and reads its answers as a reference point.
What it is
The specification defines two methods:
Ping(): No arguments, and an empty reply. On receiving it an application should do nothing but reply. Which object path it's sent to doesn't matter.GetMachineId(): Returns a hex-encoded UUID for the machine the process runs on, read on Unix from/var/lib/dbus/machine-idor/etc/machine-id. The path doesn't matter either.
The specification notes that the reference implementation handles both automatically, and the bus itself is expected to implement the interface too. So a Ping to org.freedesktop.DBus measures the bus answering for itself, and a Ping to a service measures the trip through the bus to the service's connection and back, with no work of the service's in it. A quick Ping beside a slow method points at the method rather than the bus.
Like any call, a Ping to a name nobody owns may start the service, unless the caller sets the flag that forbids starting one. Sandbox proxies decide it like other calls: In the use case of a Flatpak application that couldn't reach a service, the probe recorded Ping org.freedesktop.Notifications as hidden, answered org.freedesktop.DBus.Error.NameHasNoOwner, and Ping org.freedesktop.portal.Desktop as passed.
How lamco-dbus-tools reads it
dbussee record records Ping and GetMachineId as they cross the bus. dbusdo call sends a Ping, once or repeated, with its distribution at the caller, and --no-auto-start keeps it from starting anything. dbustell timing pairs each call with its answer and gives the floor, the shortest call the bus answered itself: A figure near the floor says only that the answer came at once. With --caller it joins dbusdo's calls to the recording's and gives the figure at the caller, at the bus, and both trips across the socket. With the kernel part, --split divides each call at every socket.
dbussee record --all --duration 10 --out rec.json & # record while the calls are made
dbusdo --out acts.json call --repeat 100 --no-auto-start com.example.Svc /com/example/Svc org.freedesktop.DBus.Peer.Ping # 100 pings, timed at the caller
dbusdo call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Peer.GetMachineId # the bus's machine id
dbustell timing rec.json --by method # each method's answers at the bus, with the floor
dbustell timing rec.json --caller acts.json # the same calls at the caller and at the bus, side by side
Where it has been run
The README's run record doesn't name Ping or GetMachineId in any run, so it doesn't cover this interface by name. The README's own first-five-minutes example times GetNameOwner, and the kernel part's runs split calls to logind and the user's service manager without naming the method. The use case "An app that can't reach a service", whose probe sent the pings quoted above, was run from its own recording, among the use cases run between 2026-11-30 and 2026-12-02.
Findings
Related
- eBPF on the bus's sockets, which splits a call at every socket.
- A slow call: The bus or the service?
- Time a call, repeat it for a distribution, see both ends, and split it at every socket.
- Time on a bus, what each figure holds.