After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710741 - some mainloop instrumentation
some mainloop instrumentation
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-10-23 17:32 UTC by Matthias Clasen
Modified: 2013-11-23 05:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.59 KB, patch)
2013-10-23 17:32 UTC, Matthias Clasen
none Details | Review
stap script (565 bytes, text/plain)
2013-10-23 17:32 UTC, Matthias Clasen
  Details
tracking source addition/removal (1.03 KB, patch)
2013-10-24 12:08 UTC, Matthias Clasen
accepted-commit_now Details | Review

Description Matthias Clasen 2013-10-23 17:32:03 UTC
Created attachment 257942 [details] [review]
patch

Here is a patch that adds dtrace/systemtap markers around the dispatching of sources in gmain.c.

Together with a script like the attached one, it produces output like this:

                        Source Total (us)      Count   Avg (us)
                       unnamed       2972         58         51
     GDK X11 Event source (:0)         84          1         84

which gets updated once every second. Adding names to more sources will make this much more useful.
Comment 1 Matthias Clasen 2013-10-23 17:32:25 UTC
Created attachment 257943 [details]
stap script
Comment 2 Matthias Clasen 2013-10-24 12:08:35 UTC
Created attachment 258009 [details] [review]
tracking source addition/removal
Comment 3 Colin Walters 2013-10-24 12:19:35 UTC
Review of attachment 258009 [details] [review]:

Makes sense to me!