Integrate Sysprof profiling with core libraries and toolkits
Description
Performance profiling across the platform is difficult because it requires tying many systems together without the tooling to do so. Sysprof can be (and is) the tool to do this going forward across applications and platform libraries.
Goals
The goal is to enable developers of our platform, and using our platform, to troubleshoot issues on their own in a much simpler format. Currently, developers need to know a lot of different tooling depending on which platform component they are troubleshooting or tuning.
The new Sysprof-3 ABI provides a number of tools that can be integrated into tooling without leaking any additional libraries or requirements. Sysprof can integrate with the libsysprof-capture-3 static library to provide additional insight from libraries, applications, compositors, and more.
Scope
- Gtk3/4
- GLib (Possibly)
- GJS
- PyGObject
- Mutter
- GNOME Builder
- Applications
- D-feet/Bustle
People on charge & contact
- Christian Hergert chergert@gnome.org
Instructions to achieve the goals
Label for tracking the initiative
9. Initiative: Platform Profiling
Text for the initiative issue in projects
List of projects & tasks
- Gtk 4 - MR to port to sysprof-capture-3 and MR to switch to new profiling API and MR to improve marshallers
- Gtk 3 - MR to backport GdkProfiler
- GJS - MR to port to use GJS_TRACE_FD= and MR to speed up sample captures
- Builder - Already ported to sysprof-capture-3, sysprof-ui-3
- Mutter - MR add sysprof-capture-3 based profiler
- GLib - MR to fix marshallers
- GNOME Shell - MR to link GJS_TRACE_FD
How can I help
- App Developer
- Add an optional
sysprof-capture-3
dependency to your project, use-Dprofiler=true
to enable - Call
sysprof_capture_writer_new_for_env()
frommain()
or similar - Add samples, marks, files, metadata, or anything else using the
sysprof_capture_writer_*()
API
- Add an optional
- Library Developer
- Get in contact to determine if creating a new
*_TRACE_FD=
environment variable makes sense for your library
- Get in contact to determine if creating a new
- Bindings Developer
- Get in contact to determine an environment variable we can use to pass to your bindings system. For example, GJS will use
GJS_TRACE_FD=
. - Check for environment variable, if available,
sysprof_capture_writer_new_from_fd()
- Write interesting events using the
sysprof_capture_writer_add_*()
API - Get in contact about how we can best visualize your data
- Get in contact to determine an environment variable we can use to pass to your bindings system. For example, GJS will use