flamegraph-rs / flamegraph

Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3
Apache License 2.0
4.61k stars 141 forks source link

Is it possible to profile only a specific part of a program? #331

Closed MoGuGuai-hzr closed 2 months ago

MoGuGuai-hzr commented 2 months ago

Hello, I am a newbie in performance profile. I would like to know if it is possible to profile only a part of a program.

The program may include pre-processing (reading, building test data), core content, and post-processing (validation, output, etc.), where the core content might only account for a very small portion of the total execution time (1% or less).

Directly using flamegraph generates a very large perf.data (perhaps several GBs).

I would like to know

djc commented 2 months ago

flamegraph (on Linux at least) is mostly a thin wrapper around perf and the inferno library for building SVG flamegraphs from perf record output. Although I've been maintaining this wrapper I am no expert on the features of perf either, and I don't really consider "support" in scope for this issue tracker. Sorry!