I have been working on profiling a golang program and trying to generate differential flame graph of two pprof files.
Steps:
- generate
first.pprof
file - improve code, then generate
second.pprof
file ./stackcollapse-go.pl first.pprof > before.folded
But it seems that the stackcollapse-go.pl
does not work as I expected, the before.folded
is empty.
So what's the right way to generate differential flame graph of go program?
stackcollapse-go.pl
doesn't take in the raw protobuf. You need to translate your .pprof into the right textual format.So first we get the raw data, suitable for passing to
stackcollapse-go.pl
Now we can pass it through
stackcollapse-go.pl
You can then use the flamegraph.pl script to get the final svg