statistical profiler which outputs in format suitable for FlameGraph.

INSTALL:

Simply run:

pip install git+https://github.com/evanhempel/python-flamegraph.git

USAGE:

Run your script under the profiler:

python -m flamegraph -o perf.log myscript.py --your-script args here

Run Brendan Gregg's FlameGraph tool against the output:

flamegraph.pl --title "MyScript CPU" perf.log > perf.svg

Enjoy the output:

Attic create flame graph