[XRay][tools] Updated stacks tool with flamegraph output.

Authored by kpw on Oct 6 2017, 3:33 PM.



As the first step to allow analysis and visualization of xray collected data,
allow using the llvm-xray stacks tool to emit a complete listing of stacks in
the format consumable by a flamegraph tool.

Possible follow up formats include chrome trace viewer format and sql load

As a POC, I'm able to generate flamegraphs of an xray instrumented llc compiling
hello world.

Diff Detail

kpw created this revision.Oct 6 2017, 3:33 PM
dberris accepted this revision.Oct 6 2017, 5:18 PM

LGTM with some nits and style issues.

Thanks, @kpw!

I suppose you're updating the documentation on how to generate the flame graphs too, at some point?

336 ↗(On Diff #118100)

In LLVM's style guide, we don't put names to TODO's (just // TODO:).

594 ↗(On Diff #118100)

Same here (TODO:).

599–600 ↗(On Diff #118100)

Maybe lift out of the loop and clear, instead of creating and destroying one every iteration?

621 ↗(On Diff #118100)

Do you actually need a std::stack, as opposed to just using a std::vector, or a SmallVector?

738–742 ↗(On Diff #118100)

nit: Enclosing curlies for single-statement bodies not required in LLVM style.

This revision is now accepted and ready to land.Oct 6 2017, 5:18 PM
kpw updated this revision to Diff 118840.Oct 12 2017, 1:54 PM

Updating with Dean's review comments.

dberris accepted this revision.Oct 12 2017, 3:02 PM

LGTM -- thanks @kpw!

This revision was automatically updated to reflect the committed changes.