D-Bus optimizations
David Zeuthen
zeuthen at gmail.com
Thu Mar 8 09:53:42 PST 2012
On Thu, Mar 8, 2012 at 12:27 PM, Havoc Pennington <hp at pobox.com> wrote:
> A great diagnostic for dbus could be an env variable, and if set, it
> would just print to stderr every time someone blocked on the dbus
> connection. It could keep track of nice human-readable descriptions of
> recently-sent serials, in order to log them usefully:
>
> * blocked on org.foo.Bar.frobate for 10ms
> * blocked on com.bar.Baz.frombulate for 5ms
That's not a bad idea. A related and more general idea is complaining
if the main loop on the main thread blocks for more than N msec - I
think someone on Planet GNOME did a cute hack for this in GLib but I
don't think it's in mainline. Ideally you'd tie this in with the OS
problem reporting framework, automatic telemetry capture etc. etc.
> that kind of log could really show people the problem, if they have
> this problem. You could imagine other logging too, like quantity of
> data sent and how it was batched up:
>
> * wrote 2 messages total of 314 bytes
In GLib we have G_DBUS_DEBUG for this, see
http://developer.gnome.org/gio/unstable/ch03.html
which does some of these things including pretty-printing each D-Bus
message like this
http://developer.gnome.org/gio/unstable/GDBusMessage.html#g-dbus-message-print
if so requested. It has proven to be useful when dealing with bug reports.
David
More information about the dbus
mailing list