Monitoring message returns, using dbus-monitor

Robert McQueen robert.mcqueen at collabora.co.uk
Tue Mar 7 03:28:00 PST 2006


Stefan Eilers wrote:
> Hi!
> 
> Currently I try to generte Sequence charts out of log-files, generated by the 
> dbus-monitor.

It's probably not a good idea to try and do string parsing on the output
of dbus-monitor - there's no guarantee that the format won't change or
be modified, making your tool very fragile. It's not tricky to modify
dbus-monitor or write something similar to output the format you need.

> dbus-monitor wants to receive message returns:
> 
>       dbus_bus_add_match (connection,
> 		          "type='method_return'",
> 		          &error);
>
> Unfortunately this was never triggered. But I am sure, some of the function 
> calls have to return anything.
> 
> Is this an known issue?

It's not an issue, it's expected behaviour. Match rules are only used by
the bus daemon when considering messages which have no recipient set.
Messages like method calls and returns which are sent to a specific
recipient are never sent to other bus members such as your dbus-monitor.

One thing I've been thinking would be useful for debugging was some kind
of bus snooping mode where you could set a flag in the bus daemon to
make it allow certain clients (dbus-monitor) to have their match rules
applied to other people's messages. Obviously you would only want this
when testing so it should be some flag or environment variable which you
set to change the bus daemon's behaviour.

> Thanks!
> 
> Regards, Stefan

Regards,
Rob


More information about the dbus mailing list