On Mon, 2012-11-19 at 00:55 +0100, Bastien Nocera wrote: > Came the idea of using of watchdog thread, based on the mainloop, which > would check for how long the mainloop was running a particular > iteration, and have to dump a backtrace if the main loop was blocking on > a particular task for more than X amount of time. I had a similar idea for debugging folks, since there’s something blocking the main loop there too. My approach is to add some extra SystemTap probes to GLib to output information about the main loop and its events. These can be dropped into a log file and analysed later, or piped to a program running at the same time as the shell and analysed in real time. > Does anyone have code like that available? If not, where would one plug > that code into the main loop code in gmain.c? I started writing a ‘Main Loop Visualiser’ to do this. I didn’t get very far before I ran out of time, but the foundations are there if you think it’s worth pursuing. It takes in a log file generated by a SystemTap script and visualises it. The visualisation is only partially complete, but the log file stuff is mostly there. The main downside is that this would require gnome-shell to be run under SystemTap. https://www.gitorious.org/main-loop-visualiser/main-loop-visualiser The necessary SystemTap additions to GLib are languishing in a branch which I’ve just pushed here: https://www.gitorious.org/~pwithnall/gnome/pwithnalls-glib/commits/stap-probes I’m interested in working on this further, but I don’t have any time for it at the moment. Philip
Attachment:
signature.asc
Description: This is a digitally signed message part