About performance of D-Bus
vasanth raj
vasuvraj21 at gmail.com
Mon Jun 16 22:37:29 PDT 2008
hi all
conn = dbus_bus_get (DBUS_BUS_SESSION, &derror);
if (!conn)
lose ("Cannot get connection: %s", derror.message);
g_print ("(expecting assertion...)\n");
gconn = dbus_connection_get_g_connection (conn);
if (gconn)
lose ("Retrieved DBusGConection from plain DBusConnection");
/* Check DBusGConnection -> DBusConnection -> DBusGConnection */
gconn = dbus_g_bus_get (DBUS_BUS_SESSION, &gerror);
if (!gconn)
lose ("Cannot get connection: %s", gerror->message);
conn = dbus_g_connection_get_connection (gconn);
if (!conn)
lose ("Cannot get DBusConnection from DBusGConnection");
gconn2 = dbus_connection_get_g_connection (conn);
this is the portion of code where i hav problem .. here when i am comparing
the gonn ?& gcoon2 i see that both doesnt match as i see that gconn2 alwaqys
returns 0...any inputs on this will be a great help 4 me
thanx in advance
vasanth
On Wed, Jun 11, 2008 at 11:00 AM, Kalle Vahlman <kalle.vahlman at gmail.com>
wrote:
> 2007/10/25 Havoc Pennington <hp at redhat.com>:
> > Hi,
> >
> > Kalle Vahlman wrote:
> >>
> >> I'm not sure if the D-Bus daemon already has such logging facilities,
> >> but storing information on the amount of messages, average/peak sizes
> >> of payloads and identifying who sends how much during regural daily
> >> usage should be very interesting to chart.
> >>
> >
> > Indeed. This is most likely very simple: an easy approach would be to
> hack
> > the daemon to send a signal message out whenever the data changes, then
> have
> > a little app that connects to dbus and gets these messages. The only
> trick
> > is, don't count the signals themselves ;-)
>
> This has been sitting in my inbox as a TODO for quite some time and
> few weeks ago I went ahead and hacked something up. Then got busy etc.
> but now the code is available at
>
> http://gitweb.pingu.fi/?p=dbus.git;a=summary
>
> There's two new things in the repo (both controlled by the --enable
> option for configure):
>
> In libdbus there now is a trivial traffic logging support by recording
> data from DBusMessages into a file. This is public API with log domain
> support so you could use it in whatever application you want to for
> recording messages for traffic profiling.
>
> And then there's the dbus-daemon portion which records all outgoing
> messages using the above system. I decided that this would be the most
> interesting data to start with, as it includes _all_ delivered
> messages even when there are multiple recipients. Of course it doesn't
> record the incoming messages that don't have a recipient but that's
> for another day.
>
> The data recorded is as follows:
>
> domain ; sender ; destination ; message type ; signature ; size(bytes)
> ; sha-1 of message body ; message timestamp (seconds from epoch)
>
> Obviously, this means sha-1 calculations for each message recorded as
> well as disc access so it definitely will degrade performance :) The
> uniqueness of a message is an important factor though, so I think it
> is worth it. It's not like this code is intended to run on production
> systems anyway ;)
>
> The profiling has two enviromental variables:
> - DBUS_TRAFFIC_PROFILING for enabling/disabling the profiling (set/unset)
> - DBUS_TRAFFIC_PROFILING_LOG for controlling where to write the file
>
> Let me know if I've done something silly in the code. I've been
> running it on my N800 for a while and last night set up my desktop
> machine to do the same, so at least it works to some degree.
>
> Haven't had time to really analyze the data, but seems like the
> average message size (in system bus at least) is pretty small and the
> bus is not so active as one might think given the impression that
> "everything" uses D-Bus. There were some peaks though and seems like
> the system bus is more active so it should be interesting to see what
> happens there too.
>
> --
> Kalle Vahlman, zuh at iki.fi
> Powered by http://movial.fi
> Interesting stuff at http://syslog.movial.fi
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080617/5fe3db18/attachment.htm
More information about the dbus
mailing list