New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for FlameGraph output #15
Conversation
* New, optional command line parameter: -f * If enabled, writes folded call stacks to output file, instead of statistics * Use with the FlameGraph tool: https://github.com/brendangregg/FlameGraph
Cool.
|
Maybe have the collector strictly just collect stack samples, and a different object would filter and format samples, with That means the collector would always collect a list of frames though (in case the formatter needs that), the default collector would be the one folding those into a counter. And assuming the formatters don't alter the collector, this would allow multiple outputs from a single collection pass. |
Good idea. What do you think of the changes? |
* Just store stacks during collection phase, process them afterwards * Add --max-stacks option for plop output * Change file extension to .flame for Flamegraph output
c1a39c8
to
68d5b8c
Compare
I just fixed the last commit, in case you're wondering. After a semi-failed |
@andreasf the ArgumentParser conversion should probably live in a separate PR (well played on Could use a list literal for BTW if you initialise ArgumentParser with Maybe rejiggle things around in 3 different PRs, one for the ArgumentParser conversion, one for the Formatter extraction (if @bdarnell thinks those are good ideas) and the 3rd one with just the flamegraph output? |
You're right on all points. I thought about doing a separate PR for the argparse changes, but since the last commit is from 8 months ago, I was too lazy to split it up. People over processes ;-) |
Wow, this looks great. For future reference I'd have a slight preference for separate PRs for the PEP8 changes and the move to argparse, but it's not worth splitting it up. The one thing I might change is actually the |
Add support for FlameGraph output
Thanks! |
of statistics