csci-5802-tooldemo-flamegraphs created by GitHub Classroom
| Description | Use Cases | Results | Setup | Run | Evaluation | 
Disclaimer: Sorry, no GUI or friendly tools here for C++. The process still is not that difficult once you become familiar with
Flame graph profiling with C++ is actually quite simple, especially if you are familiar with Unix utilities and pipe/filter models. These instructions also work for C programs.
These instructions will only work for Linux, as the methods here have Linux kernel dependencies. There are similar methods described for Windows, Solaris, and OSX on Brendan Gregg’s website.
Brendan Gregg’s Flame Graph tool is the current defacto tool for digesting stack information and turning it into a visual. The differences all lie in how you acquire the stack information.
The easiest way to get the tool is to clone the git repo:
git clone --depth=1 https://github.com/brendangregg/FlameGraph.git
You will want to clone this repo from within a directory that you can use to dump results and work from
This step is not 100% necessary, but it does help avoid inlined and omitted method names, and makes your results more meaningful.
The only thing required here is changing the compiler flags. You will want to add -g if you are building manually, or simiply build from your IDE in the debug configuration to enable debug symbols.
Occasionally, g++ will remove or share stack frame pointers and method stacks will be incorrectly reported. To prevent the compiler from doing this, add the followig flag:
-fno-omit-frame-pointer
You are now setup and ready to profile your C/C++ application on Linux! Read more in our instructions on profiling and generating flame graphs for C++ programs.