GNOME Shell Profiling

Now that we have a Gjs profiler we can start looking at doing some fun things with it.

Today I wrote a couple line patch to GNOME Shell to toggle on and off the profiler using SIGUSR2. So if you build Gjs and gnome-shell with the appropriate patches, you can do something like:

<br />
gnome-shell --wayland<br />
# .. inside shell<br />
kill -SIGUSR2 &lt;pid&gt;<br />
# .. exercise shell a bit<br />
kill -SIGUSR2 &lt;pid&gt;<br />
# .. now look at /tmp/gjs-profile-$pid<br />

If you open that file up with my Sysprof improvements, you can browse around the profile information containing JavaScript stacks.

It looks something like this.

Happy bug hunting!