flamegraph-rs / flamegraph

Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposed feature: filter/match

jedbrown opened this issue · comments

Brendan Gregg's instructions for the perl tools has lots of examples that use grep to prune the folded traces. This Rust implementation is nicer in many ways, but I often find myself missing this feature (mostly when working with --perfdata perf.data) and relearning some conventions of the perl implementation.

I can imagine this being addad a regex to match or by passing a representation through an external filter (likely ripgrep) or by having an option to emit output similar to stackcollapse-perf.pl with another to read it (usually from stdin) so the user can construct such pipelines. I wonder if the maintainers have thought about how this should be implemented.

flamegraph is a fairly thin wrapper around the inferno crate, which already has some support for various options. However, not all of those options are currently exposed through the flamegraph CLI. If you want to submit a PR to improve on that, I'd be happy to review! Have a look at the FlamegraphOptions and the conversion to inferno options.