Today I managed to hack together GSource instrumentation with Tracy. Now this gets into a more complex territory because it's in glib, so Tracy needs to be a separately installed shared library, and it should only start its profiling threads in the process I care about (gnome-shell) and not in all processes that use glib. Tracy has manual profiler start/stop support for this, but I had to add a function that checks whether the profiler had started, and tweak the meson build to output pkgconfig.