Skip to content

spiiin/converters_to_flamegraph

Repository files navigation

converters_to_flamegraph

Scripts for converts profilers output to flamegraph

Flamegraphs - https://github.com/brendangregg/FlameGraph

My versions of scripts to convert profiler output to folded stacks (other are staled or don't work for me).

Pipeline

Windows

  1. Collect data with EtwProf. Others profilers thar produce etl files are good too.

etwprof profile -t=418996 --output profile_result -m

This file can be opened with Windows Performance Analyze. It can show data as flamegraph, but I want to produce svg too.

  1. Transform etl file in csv xperf -i "profile.etl" -o perf.csv -target machine -symbols

  2. Convert csv to folded_stacks format (it convert perf.csv to perf.folded)

xperf_csv_to_collapsed_stacks.py

  1. Run flamegraph.pl for convert folder stacks to svg file

flamegraph.pl perf.folded > perf.svg

It can be opened with any modern browser.

macOS/iOS

  1. Profile application with Instruments -> Time profile. Select range of data that need to be exported.

  2. (!) Choose profile output columns - number of samples, symbols. Disable all other columns

  3. Select row that you want to export (root node for export all data). (!) Do not select all rows, just root. macosx

  4. Copy data (select Edit->Deep Copy from menu) and paste it to any text editor. Save file as sample.txt

  5. Run instruments_to_collapsed_stacks.py

  6. Run flamegraph.pl for convert folder stacks to svg file

flamegraph.pl perf.folded > perf.svg

Also possible grab output from Intstruments -> Allocations similar way. instruments_allocation_to_collapsed_stacks.py script can convert it to folded stacks too.

About

Scripts for converts profilers output to flamegraph

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages