Redirected from page "Sysprof"

Clear message

Sysprof

Sysprof is a modern system-wide profiling tool that helps in finding the functions in which a program uses most of its time and resources. It provides detailed, accurate, and fast profiling of the entire Linux system, including the kernel and all userspace applications (and their interactions) at the same time.

https://blogs.gnome.org/chergert/files/2023/07/Screenshot-from-2023-07-26-22-04-24.png https://blogs.gnome.org/chergert/files/2023/07/Screenshot-from-2023-07-26-22-54-06.png https://blogs.gnome.org/chergert/files/2023/07/Screenshot-from-2023-07-26-23-14-16.png

https://blogs.gnome.org/chergert/files/2023/08/Screenshot-from-2023-08-24-17-20-19.png

Among its key features are:

  • Fast, no-nonsense graphical user interface that is easy to use, for any tester or developer;
  • No patching/recompiling necessary;
  • Accurate measurements, paired with clear and beautiful graphical data visualization for various resource counters (cpu, net, mem, cpufreq, energy consumption, battery charge, etc), logs, files, and marks with visualizers for them.
  • Ability to save captured profiles, or open someone else's "syscap" file that they have shared with you in a bug report.
  • Various nice data visualizations for your selected portion of the timeline!

For the more technically-inclined among you, sysprof provides:

  • Callgraphs (based on stacktraces obtained via perf);
  • A binary capture format (which makes it very convenient to work with capture files to write custom tooling, unlike perf.dat or pprof);
  • A “control fd” that can be sendmsg()d to peers or inherited by subprocesses w/ SYSPROF_CONTROL_FD=n set allowing them to request a ring buffer (typically per-thread) to send accessory information which is muxed into the capture file;
  • Memory profilers (via LD_PRELOAD) which use the above to collect allocation records and callgraphs to visualize temporaries, leaks, etc.;
  • Integration with language runtimes like GJS (GNOME’s "Spider Monkey" engine used by GNOME shell and various applications) to use timers and SIGPROF to unwind/collect samples and mux into captures;
  • Integration with platform libraries like GLib, GTK, Mutter, and Pango which annotate the recordings with information about the GPU, input events, background operations, etc.;

  • The ability to decode symbols at the tail of a recording and insert those mappings (including kallsyms) into the snapshot. This allows testers to provide a compressed recording that developers can open locally without the same binary versions or Linux distribution.

Installation

Sysprof can be found as a native package in many recent Linux distibutions, or obtained from GNOME Git, inside the sysprof module:

git clone https://gitlab.gnome.org/GNOME/sysprof

If building it yourself, you need to compile it using the kernel headers package provided by your distribution. Read then the Sysprof quickstart to set it up.

Documentation

Useful resources

Examples of use


CategoryDevelopment

Apps/Sysprof (last edited 2023-08-25 01:25:26 by JeffFortin)