Match rules sorted by interfaces

Alban Crequy alban.crequy at collabora.co.uk
Fri Oct 1 11:00:57 PDT 2010


Hi,

D-Bus match rules are no longer checked linearly but are in a lookup
table sorted by (type, interface). It is implemented in
https://bugs.freedesktop.org/show_bug.cgi?id=23117

It is better to always specify the type and the interface in the match
rules, so dbus-daemon only runs a minimum amount of match rules when a
message incomes.

I looked at the list of match rules on Debian Sid with GNOME with the
patch attached to https://bugs.freedesktop.org/show_bug.cgi?id=24307

Of course it depends on the applications I was using during my test.
Here is the numbers I got:

== On the system bus ==

724 match rules

- all the match rules have a "type='...'" criteria

- 26 rules don't have a "interface='...'" criteria. They are generated
  by the processes:
   - /usr/lib/policykit-1/polkitd
   - /usr/lib/udisks/udisks-daemon
   - /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
   - /usr/sbin/console-kit-daemon
   - /usr/lib/upower/upowerd
   - /usr/sbin/NetworkManager
  The rules are:

type='signal',member='NameOwnerChanged',sender='org.freedesktop.DBus',arg0=':1.26'
type='signal',member='NameOwnerChanged',sender='org.freedesktop.DBus',arg0='org.freedesktop.ConsoleKit'
type='signal',member='NameOwnerChanged',sender='org.freedesktop.DBus',arg0='org.freedesktop.DBus'
type='signal',member='NameOwnerChanged',sender='org.freedesktop.DBus',arg0='org.freedesktop.PolicyKit1'
type='signal',path='/org/freedesktop/ConsoleKit/Manager',sender='org.freedesktop.ConsoleKit'
type='signal',path='/org/freedesktop/ConsoleKit/Seat1',sender='org.freedesktop.ConsoleKit'
type='signal',path='/org/freedesktop/ConsoleKit/Session1',sender='org.freedesktop.ConsoleKit'
type='signal',path='/org/freedesktop/DBus',sender='org.freedesktop.DBus'
type='signal',path='/org/freedesktop/PolicyKit1/Authority',sender='org.freedesktop.PolicyKit1'
type='signal',path='/org/gnome/PolicyKit1/AuthenticationAgent',sender=':1.26'



== On the session bus ==

4847 match rules

- 15 rules don't have a "type='...'" criteria. They are generated by
  the processes:
   - /usr/lib/gvfs/gvfsd
   - and applications using to libgvfsdbus.so or libgvfscommon.so

interface='org.gtk.vfs.MountTracker',member='mounted',sender='org.gtk.vfs.Daemon'
interface='org.gtk.vfs.MountTracker',member='unmounted',sender='org.gtk.vfs.Daemon'

- some rules don't have a "interface='...'" criteria. They are
  generated by:
   - empathy
type='signal',path='/org/freedesktop/Telepathy/Logger'

Alban


More information about the dbus mailing list