Commit 7fd7bdc
committed
feat(callgrind-utils): add to_flamegraph SVG export
Add CallGraph::to_flamegraph / to_flamegraph_file mirroring the existing
to_json API, rendering a flamegraph SVG via the inferno crate.
To weight frames by cost, the parser now captures per-function self cost
and per-edge inclusive cost from the positions:/events: layout (first event
column, e.g. Ir); costs live outside Node so identity/dedup is unchanged.
redact() re-keys self costs onto redacted identities.
Folding walks roots top-down, distributing each function's aggregated self
cost across incoming paths in proportion to call inclusive cost; recursion
and cycles are terminated via an on-path guard and budget pruning.1 parent bdc4911 commit 7fd7bdc
9 files changed
Lines changed: 588 additions & 10 deletions
File tree
- callgrind-utils
- src
- tests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments