Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
After many months of work, I'm very pleased to finally announce KDAB's latest R&D project to the public: hotspot - a GUI for the Linux perf profiler.
I have used Linux perf a lot over the past years. It is an extremely powerful and useful tool. But its complexity makes it very hard to use. You need to know and enable quite a few options of perf report
before the results become understandable. To educate people, I started giving talks on the subject at various conferences. Additionally, KDAB now also offers a training about Debugging and Profiling tools, with a large section on Linux perf. Finally, I started contributing upstream to make perf
more usable for my needs as a C++ application developer.
But all this time I kept thinking: Why can't we have a proper GUI for Linux perf? Something similar to KCachegrind would already be quite helpful. And I knew I'm not the only one with that wish - over the years I heard many people complain about a lack of a decent GUI for Linux perf. Thankfully, KDAB gave me the opportunity to fix this issue. Today, I am finally confident enough to release a first version of hotspot to the wider public. Download hotspot v1.0.0 from GitHub, it's free and open source software!
First and foremost, hotspot is a replacement for perf report
. It is a GUI that takes a perf.data
file, parses and evaluates its contents and then displays the result in a graphical way. The screenshots show the most important current features in action:
The summary view of hotspot gives a quick overview of the analyzed perf.data file and the system it was recorded on.
The bottom-up view displays the aggregated sample costs from where the cost is actually spent. This shows the hot functions in your code base.
The top-down view of hotspot allows you to drill-down the call graph to find the most costly functions in your code base.
Hotspot comes with a built-in flamegraph visualization. It is interactive and allows searching, zooming and more.
Hotspots caller / callee view aggregates the data like KCachegrinds main table view. This is useful to find unexpected costs of frames in the middle of the call stacks.
Compared to perf report
, hotspot has the following advantages in my opinion:
perf.data
file with hotspot, no need to remember the magic invocation perf report -g srcline -s dso,sym,srcline --inline
.perf record -e cycles,instructions
, perf report
will show you a menu to select either cycles, or instructions. But it does not show both costs side-by-side.perf report
, which is a combination of a Caller/Callee view and the Top-Down view. Hotspot splits uses visualizations known from other tools like KCachegrind, VTune or heaptrack, making it more familiar and easier to understand for newcomers.perf report
is, even today, lacking proper cross-platform unwinding support to analyze a perf.data
file recorded on a 32bit ARM machine on a x86(-64) machine. The other combinations between aarch64 and x86(-64) work, but at least in my day-to-day work, I still have to work a lot with 32bit ARM embedded boards, making perf report
rather useless. Additionally, perf report
only knows the single --symfs
command line switch to set the sysroot. For many situations, this is not enough, e.g. when you deploy hand-compiled code manually from outside the sysroot. Hotspot comes with four options for that purpose: --sysroot
, --debugPaths
, --appPath
, --extraLibPaths
. Have a look at hotspot --help
for more information, or head over to the official README.Overall, I encourage you to try it out. Hotspot depends on a few external libraries, such as elfutils, Qt 5.6+ and some KDE Frameworks. On modern distributions, it should be straightforward to compile it. If you have any issues, read the documentation, and report bugs you encounter in the issue tracker.
I have so far concentrated on making hotspot a good replacement for the common perf report
use-case. But the perf
tool suite is extremely large and versatile. Many of the more advanced analysis routines are not yet supported by hotspot. On the roadmap for the next release of hotspot, we plan to add the following features:
wip/timeline
branch)perf record
from within hotspot, such that you don't need to type perf --call-graph dwarf
all the time. My colleague Nate is working on that already.In the long term, I also consider making hotspot a generic GUI for all kinds of performance data - it could e.g. become the analysis frontend for heaptrack data.
Also note that hotspot is intended to be a standalone application. I have no intention to integrate it in an IDE. If you are looking for such a thing, have a look at QtCreator's CPU Usage Analyzer. It shares the same backend with hotspot and has many of the same visualizations available in hotspot.
If you are interested in the project and want to help out, please contribute! You can submit patches via GitHub pull requests.
I would like to end this announcement by saying thank you to a couple of people who have helped me bring this project to fruition:
perfparser
and the CPU Usage Analyzer in Qt Creator. Without his prior work, I would be far from where I'm today. I hope my contributions upstream make up for it!Stay on top of the latest news, publications, events and more.
Go to Sign-up
Learn Modern C++
Our hands-on Modern C++ training courses are designed to quickly familiarize newcomers with the language. They also update professional C++ developers on the latest changes in the language and standard library introduced in recent C++ editions.
Learn more
2 Comments
8 - Jul - 2017
Martin Koller
using hotspot-v1.0.0.tar.gz
Trying to clone:
25 - Jul - 2017
Kevin Funk
Handled here: https://github.com/KDAB/hotspot/issues/61