offline post-processing of collapsed stacks without running a workload
I often need to analyze collapsed stacks produced using different tools or on different systems. This can be done today with a slightly awkward command (cf. https://github.com/flamegraph-rs/flamegraph/issues/259#issuecomment-1579859541)
$ flamegraph --post-process 'cat my-stacks.txt' -- /bin/true
This actually runs /bin/true under perf (or dtrace on MacOS) and sends its collapsed stacks to cat my-stacks.txt, which ignores them. This has been harmless for me on Linux, but:
- It's a bit weird and unintuitive
- It requires dtrace (and sudo) on MacOS
A similar mode can be accomplished using --perfdata, which does not require a workload (and silently ignores one if passed).
I'd like to propose:
- adding
--bikeshed-stacks my-stacks.txtthat reads from the file. It would then run--post-process(if given). It would conflict with--perfdataand with a specified workload. - make
--perfdataconflict with a specified workload (so it isn't silently ignored)
Would such a contribution be welcome and is this design good in principle? Any preference on naming?
I'm happy to merge support for your use case. Want to throw up a PR so we can iterate a bit on the exact interface/design?