Debugging and Profiling C++ applications on Linux
This introductory course explores a range of tools that allow developers and testers to find bugs and identify performance issues in C++ applications on Linux. The tools presented cover a wide range of problems, from general-purpose debugging and CPU profiling to Linux-specific high-level analyzers.
The workshop primarily focuses on tooling for application development on the Linux desktop. It will be discussed how to apply the same tools to development on embedded Linux.
The course is valuable to any C++ developer that wants to get an overview of the tooling landscape on Linux. Some advanced C++ topics will be touched on that impact performance but otherwise only a solid basic understanding of C++ and Linux is required to attend.
Computer Setup
This training is all about tools related to debugging and profiling. For the
attendees to successfully follow along and fulfill the hands-on lab
objectives, it is crucial for them to have access to those tools.
A VirtualBox VM with most of the tools installed will be provided in advance
of the course. Some tools are limited in the VM, as the VM has no support for
accessing the performance counters (PMU) of the host. This mainly affects RR,
which I will only demo then outside of the VM. It also
affects perf, although the performance counter support there is
not needed for the labs. Nevertheless perf can optionally be
installed on the host to see the full performance counter support.
Note: VMWare is nowadays available for free, even for commercial use. It has
better support for PMU pass through, you may have success in running
the VM image within VMWare to get access to some more features of perf. RR
will still not be working properly though.
In case you want to work on the labs on your own bare metal linux installation
outside the prepared VM environment, please make sure to setup your system to have at least:
- a working build setup to compile C++ code
- GCC 5.x or Clang 3.6 or higher
- cmake 3.12+
- Qt 6 build environment
- Kernel >= 4.x
- gdb (optionally cgdb as well)
- RR
- root privileges
- debug symbols (It is sufficient to setup debuginfo)
- Linux perf
Packages on Ubuntu: linux-tools-common linux-tools-generic
- hotspot
From a recent distro, or use the AppImage from
https://github.com/KDAB/hotspot/releases/tag/continuous, or build
https://github.com/KDAB/hotspot from sources
- heaptrack
From a recent distro, or use the AppImage from
https://download.kde.org/stable/heaptrack/, or build
https://github.com/KDE/heaptrack from sources

Milian Wolff has a long history of creating tools for C++ developers. He’s the main author of Massif-Visualizer, Heaptrack, Hotspot, and ctf2ctf tools now used widely to improve C++ applications' performance. He’s a Senior Software Engineer at KDAB, where he enjoys solving hard performance problems and teaching developers about debugging and profiling tools.
Milian has a Master's Degree in Physics, which explains his scientific approach to performance measurement.