DBusMessagesBox.py
DBusMessagesBox.py can monitor messages going through a D-Bus message bus and display message sequence chart with Mscgen. It connects to dbus-daemon with dbus-python.
Example of PNG output
When Rhythmbox plays a song, it prevents the power manager to suspend or hibernate (method call #13). The user is notified (method call #14). See GNOME Power Management Specification.

Example of HTML output
A video conference with Empathy involves several Telepathy components. They communicates together via D-Bus messages.
Telepathy D-Bus messages when starting a video conference
How to try it
- You need a patched version of Mscgen. Download Mscgen sources and the signal patch. Or use the signal branch of my git repository. Install it.
- Then get DBusMessagesBox.py (also available in git).
- In the __name__ function, changes the variable skip_entities.
- Start DBusMessagesBox.py in a console.
- Stop it with Ctrl-c.
- Look at the output files dbus_output.*
Features
- Call the dbus-daemon to know the names of connections (GetNameOwner).
- PNG and HTML/javascript output.
- Filter the connections to display (see skip_entities in the source).
- Method calls and returns are linked together in the HTML version.
- When connections want to receive signals from dbus-daemon, DBusMessagesBox.py knows it and displays which connections receives the signal.
Bugs
- Most bugs are silently ignored because of Bug fd.o #9980.
- When there is several recipients for a signal, there are not displayed correctly. Mscgen needs a patch for that.
- The code needs clean up and a better API to use DBusMessagesBox.py in other python programs.
API
The class DBusMessagesBox has some functions like start_recording(), stop_recording(), parse_to_mscfile(). But a lot is hardcoded and need clean up.
[…] started a page for my DBusMessagesBox.py tool. So now you can generate beautiful D-Bus diagrams like this […]
Pingback by Alban’s blog » Blog Archive » How to make a D-Bus diagram with DBusMessagesBox.py — March 29, 2008 @ 8:02 pm