Given a profile, flamescope generates a subsecond-offset heat map.
From that heat map you can select a time range and then a flamegraph will be generated for it.
git clone https://github.com/Netflix/flamescope
cd flamescope
docker build -t flamescope .
For example, a 2 min profile for the whole system:
perf record -F 49 -a --call-graph dwarf -- sleep 120
perf script --header > myapp.stacks
Copy profiles to, for example, /tmp/profiles
.
Then run flamescope
:
docker run --rm -it -v /tmp/profiles:/profiles:ro -p 5000:5000 flamescope
Open http://localhost:5000
in your browser and start using flamescope
.