Generating CPU Flame Graphs Automatically When Benchmarking With The Phoronix Test Suite
Written by Michael Larabel in Phoronix Test Suite on 31 October 2016 at 11:26 AM EDT. 4 Comments
The Phoronix Test Suite has offered basic Linux perf subsystem integration for being able to record automatically various perf metrics when running any of the hundreds of benchmarks available via our open-source benchmarking software/framework. Now with the latest development code, there is support for generating CPU Flame Graphs (FlameGraph) for each of the tests still in a fully-automated manner while benchmarking with PTS.

The previous perf module to the Phoronix Test Suite is still available and provides an easy way of getting per-test reports for the number of perf context switches, branches, page faults, etc. With Perf available and supported on the system, it's activated and used automatically when setting the LINUX_PERF=1 environment variable so that fairly simple PTS module becomes automatically activated. (Here is a fresh example of a result file with that activated.) A new feature request today was for having FlameGraph support, the graphs generated based upon Linux perf data and developed by Brendan Gregg. If you are not familiar with it, see the project site or GitHub for this stack trace visualizer.

While I hadn't played around with FlameGraph much before, it didn't take much time at all to prototype a new PTS module for being able to automatically generate flame graphs during the benchmarking process.

With this module now in phoronix-test-suite.git the "flamegrapher" is automatically loaded via the FLAME_GRAPH_PATH environment variable to point to the directory of your FlameGraph installation / Git repository. I.e. as easy as:
git clone
git clone
cd phoronix-test-suite/
FLAME_GRAPH_PATH=/home/phoronix/FlameGraph ./phoronix-test-suite benchmark redis pgbench xonotic openssl
Where if your system has Linux perf setup, from there it's all fully-automated to start/stop perf for each and every test profile being benchmarked and to save those FlameGraph SVG results alongside the other Phoronix Test Suite result data.

It's that easy and integrated. With really just a few dozen lines of integration code in its own Phoronix Test Suite module needed to further advance our benchmarking software.

As part of the Phoronix Test Suite design, this module should work with any of the hundreds of available test profiles supported by the Phoronix Test Suite. The module could be further extended to support D-Trace, etc, with Phoronix Test Suite supporting BSD, Solaris, etc.

From the local Phoronix Test Suite results viewer, the FlameGraph for each associated test is then displayed directly below the benchmark result.

Though keep in mind this support is currently considered experimental. With these graphs being stored separately and not part of the Phoronix Test Suite results XML file, there isn't yet any support for uploading this data to, the CPU flame graphs aren't merged yet if saving multiple results to the same result file, etc. But all basic functionality is there for debugging/profiling purposes if you wish to have FlameGraph results for each and every one of your Phoronix Test Suite runs for better analyzing performance bottlenecks.

Expect more to come as Phoronix Test Suite 6.8 development continues. Feel free to try it out in Phoronix-Test-Suite Git and share your feedback. Commercial support and custom engineering services available by contacting us.
Related News
About The Author
Author picture

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter or contacted via

Popular News This Week