traffic logging for dbus-daemon ?

Havoc Pennington hp at pobox.com
Fri May 16 04:20:01 PDT 2008


Hi,

On Fri, May 16, 2008 at 2:48 AM, Alexander Neundorf
<neundorf at eit.uni-kl.de> wrote:
> -add a method enableLogging(bool) to dbus-daemon

You should likely use the "client registration" pattern here, i.e.
keep track of which clients care about logging, and disable if they
all exit. This is easily done by making SetLoggingEnabled() look at
the sender of the SetLoggingEnabled() request. You'd also want to
require as many sets to "false" as you got sets to "true" (make it a
refcount). If a client exits, all of its "references" get deducted.

> -if it is enabled, information about every message is logged into some
> internal buffer of some not too small size, e.g. 64kb
> -if this buffer is full, the contents are broadcasted via a signal
> -everybody who is interested can receive that signal and process the data

This would seem to allow infinite latency if the buffer takes a long
time to fill up. I guess that is not too hard to solve though with a
timeout or something.

> Now the questions
> -what should be logged ? I guess a timestamp, the size, sender and receiver,
> more ?

First, is this the session or system bus? On the system bus there are
security considerations.

If your main interest is profiling, maybe the logged info should
reflect what's needed for that.

> -does the idea to send the logging information away make sense or should it
> better just be written to some file ? This wouldn't increase the dbus
> traffic, but it would also be less flexible.

If the purpose is profiling, I think just writing a profile file might
be fine and simpler.

> -is there already a format which is suitable for this kind of information ?
> -is there already an application which is suitable for visualizing and
> analyzing this kind of information, e.g. some networking tool ?

I don't know of anything good.

Havoc


More information about the dbus mailing list