Skip to content

offline post-processing of collapsed stacks without running a workload #371

@jedbrown

Description

@jedbrown

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. #259 (comment))

$ 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:

  1. It's a bit weird and unintuitive
  2. 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:

  1. adding --bikeshed-stacks my-stacks.txt that reads from the file. It would then run --post-process (if given). It would conflict with --perfdata and with a specified workload.
  2. make --perfdata conflict 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions