Skip to content

more systemtap mozilla event loop awareness

====================                                             ms    #
----- Event Loop:
  nsInputStreamReadyEvent                                      7119   11
----- Input Events:
  nsInputStreamPump                                            7119   11
----- Pump Events:
  thunk:nsNNTPProtocol::QueryInterface(...)                    7119   11

====================                                             ms    #
----- Event Loop:
  nsInputStreamReadyEvent                                      6284   15
  nsTimerEvent                                                  242  123
----- Timers:
  nsUITimerCallback                                             121    2
----- Input Events:
  nsInputStreamPump                                            6284   15
----- Pump Events:
  thunk:nsNNTPProtocol::QueryInterface(...)                    6283   15

As of late, I’ve noticed that Thunderbird has been pegging one of my CPU cores periodically in ways not correlated with gloda activity, the usual scapegoat.  With some enhancements to my systemtap script from last time, I can now see that it apparently takes something like 13 seconds of dominating the event loop to perform the check for new messages in my 26 subscribed news folders on  Yowch.  At least this is on a debug build!

Changes are that we now cover input stream ready events, input pump listeners, and proxied objects (which lets us see what Thunderbird IMAP gets up to).  Also, the output is more concise and only shows things that take at least 100ms of aggregate wall clock time.

Script invocation currently wants to look like this:
sudo stap -v moz-event-loop.stp /path/to/thunderbird/objdir/mozilla/dist/lib/ /path/to/thunderbird/objdir/mozilla/dist/bin/components/ | ../ `pgrep thunderbird-bin`

{ 4 } Comments

  1. Ludovic Hirlimann | March 20, 2010 at 12:56 am | Permalink

    Would I be able to figure out why I get a beach-ball almost everytime I try to compose an email using your scripts (given that I would need to make them run on osx). ?

  2. Andrew Sutherland | March 20, 2010 at 1:08 am | Permalink

    If you’re beach-balling for an extended period of time, the OS X sampler, manual invocation of Shark, or the beachball detector instrument should all be more suitable (and require much less work to adapt than my fairly linux-biased scripts).

  3. Robert Kaiser | March 20, 2010 at 7:13 am | Permalink

    Andrew, is it possibly bug 539194 that you are seeing with this “get new messages” stuff? We would be sooooo glad to get a clue of what’s up and how to fix it…

  4. Andrew Sutherland | March 20, 2010 at 5:14 pm | Permalink

    The specific thing I’m seeing seems pretty easy to reproduce and quite lengthy; assuming others are experiencing the problem, they should be able to attach a debugger or run a profiler against it and get a good number of samples. If someone has trouble reproducing, I believe that for all of the newsgroups I downloaded the entire history and brought most of them fully offline.