Re: [Rhythmbox-devel] idle rhythmbox



> The guys at intel have just released a tool called PowerTop
> http://www.linuxpowertop.org (announcement to fedora-devel -
> https://www.redhat.com/archives/fedora-devel-list/2007-May/msg00796.html
> )
>
> Anyway I installed it to play around with and noticed that rhythmbox
> was appearing fairly frequently even though it was idle and not
> playing (I forgot I even had it running). Something like 6.2% of the
> nearly 2500 wakeups in a second (output below).
<snip>
>    3.6%          rhythmbox : do_nanosleep (hrtimer_wakeup)
<snip>
>    2.6%          rhythmbox : schedule_timeout (process_timeout)

It would have been more useful getting a proper trace of where this
wakeup comes from. Was Rhythmbox idle or not when you did this?

Hi Bastien & all,

I've played with this a bit more this afternoon using the blog posts
that you mentioned. I have no idea whether what I've found is an issue
but from Federico's blog post the g_timeout_add  is seems to be a
problem. From what I found there seems to be 2 of these that are
called regularly. I may be barking up the wrong tree though.

First one is in shell/rb-shell-clipboard.c in the function
rb_shell_clipboard_idle_poll_deletions, line 764. It seems to call the
else option regularly (every 0.3 seconds from what I can tell) even
when RB is doing nothing. Not sure why it needs to do what ever its
doing with a clipboard every 0.3 seconds.

Second one is in rhythmdb/rhythmdb.c in the rhythmdb_idle_poll_events,
line 2003. When idle it runs the else branch every second. Not sure
what it does every second but being the DB it may not be fixable.

So for testing I just commented out the entire if statements (just for
fun) to see what effect it had. With that a third one came to the
fore. shell/rb-statusbar.c around line 465 there was another
g_timeout_add. I think this one is only used when the status bar is
being updated though.

That gets rid of the schedule_timeout in the list about leaving
do_nanosleep which I'm yet to even find :-)

The debugging I used was basic printf statements (silly patch included
for reference), as well as gdb.

So not sure if its headed in the right direction or not. Thoughts?

Cheers,
Pete

--- shell/rb-shell-clipboard.c.orig     2007-05-13 18:41:55.000000000 +0100
+++ shell/rb-shell-clipboard.c  2007-05-13 21:15:14.000000000 +0100
@@ -761,6 +761,7 @@

       did_sync = rb_shell_clipboard_process_deletions (clipboard);

+       printf ("PBR: poll the clip board");
       if (did_sync)
               clipboard->priv->idle_deletion_id =
                       g_idle_add_full (G_PRIORITY_LOW,
--- backends/gstreamer/rb-player-gst.c.orig	2007-05-13 18:33:00.000000000 +0100
+++ backends/gstreamer/rb-player-gst.c	2007-05-13 18:34:37.000000000 +0100
@@ -183,6 +183,7 @@

	mp->priv = RB_PLAYER_GST_GET_PRIVATE (mp);

+	printf ("PBR: GTA BG:rb-player-gst\n");
	mp->priv->tick_timeout_id = g_timeout_add (ms_period, (GSourceFunc)
tick_timeout, mp);
	mp->priv->idle_info_ids = g_hash_table_new (NULL, NULL);

--- rhythmdb/rhythmdb.c.orig    2007-05-13 18:39:24.000000000 +0100
+++ rhythmdb/rhythmdb.c 2007-05-13 21:18:00.000000000 +0100
@@ -2001,6 +2001,7 @@
                                        db, NULL);
       else
               db->priv->event_poll_id =
+                       printf ("PBR: GTA R:rhythmdb");
                       g_timeout_add (1000, (GSourceFunc)
rhythmdb_idle_poll_events, db);

       GDK_THREADS_LEAVE ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]