Products › lamco-dbus-tools › Docs

Replay a D-Bus capture's calls, and load a bus with signals

Replay a D-Bus capture's calls with dbusdo replay, checking that each ends as it did, and load a bus with signals at a set rate to see what the bus does.

Describes version 0.4.1.

Send a recording's calls again

Needs dbusdo, a recording made with --bodies raw, and the services the calls went to. Layer 5: The calls are real calls, sent as this user, and a call that changed something changes it again.

$ dbussee --quiet record --service org.freedesktop.systemd1 --bodies raw --duration 3 --out sd.json &
$ dbusdo call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.DBus.Peer.Ping \
    call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.DBus.Properties.Get ss org.freedesktop.systemd1.Manager Version \
    soft call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.GetUnit s no-such.service
$ wait
$ dbusdo --out again.json replay sd.json
3 calls sent again: 3 ended as they did, 0 differently, 0 had no answer.

Each method call to a well-known name is built again from its recorded header and body, sent with a new serial, and its answer found by that serial. replay fails, and dbusdo exits 1, when any call ends differently than it did: A reply that's now an error, an error with another name, or no answer.

What's left out, and said:

  • Calls to the bus itself. They belong to the connection that made them, such as its Hello.
  • Calls to a unique name. That connection has gone.
  • Calls whose body wasn't kept as bytes. Record with --bodies raw. A call with no body is always sent.

--service <name> sends only the calls to one name. --speed <factor> keeps the recording's gaps between calls, divided by the factor: --speed 1 as they were, --speed 10 ten times as fast. Without it the calls go one after another.

--out writes an act for each call, with the record it repeats, how that call ended then and how it ends now.

Load a bus

Needs dbusdo and a bus. Every connection with a match on the signal gets each one, so on a shared bus this loads them too.

$ dbusdo load --size 256 1000 2
2000 signals of 256 bytes in 2.00 s: 1000 a second, asked 1000; 0 sent more than a gap late

load <per-second> <seconds> broadcasts io.lamco.DbusTools.Load.Tick from /io/lamco/DbusTools/Load, each with its count and --size bytes besides, each due at its own moment. A signal sent more than a gap after it was due is counted as late, which is the sender falling behind. Record beside it to see what the bus did with them:

dbussee record --all --duration 4 --out loaded.json &
dbusdo load --size 4096 500 2
wait
dbustell signals loaded.json

The rate goes up to 1,000,000 a second and the size to 1 MiB. The run's time limit cuts a long load short.