feat: write_flamegraph defaults to symbolicated output - #71
Merged
Merged
Conversation
Rename existing public write_flamegraph to write_flamegraph_raw (always-available raw-hex rendering), make the existing write_flamegraph_symbolized a private impl detail (write_flamegraph_symbolicated_inner), and introduce a new write_flamegraph dispatcher that selects the symbolicated path when the `symbolicate` feature is on and the raw path otherwise. Bumps snmalloc-rs to 0.8.0 (breaking: the raw-rendering call site moves from write_flamegraph to write_flamegraph_raw, and the symbolicated entrypoint moves from write_flamegraph_symbolized to write_flamegraph). Updates README example and integration test. Ticket: 86aj2dwjz.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Make
HeapProfile::write_flamegraphdispatch to the symbolicated rendering whensymbolicateis on; rename the existing raw-hex API towrite_flamegraph_raw(always available); demotewrite_flamegraph_symbolizedto a privatewrite_flamegraph_symbolicated_innerimpl detail. Bumpssnmalloc-rs0.7.4 -> 0.8.0 (breaking).Why: Every interactive viewer (
flamegraph.pl,inferno, speedscope) is dramatically more useful with named frames than with raw hex addresses. Making symbolicated the default for the canonical entrypoint matches user expectations; raw-hex remains one method call away (write_flamegraph_raw) for external-symbolicator workflows or stable golden output.Cost: Breaking API rename. The raw call site moves from
write_flamegraphtowrite_flamegraph_raw, and the symbolicated entrypoint moves fromwrite_flamegraph_symbolizedtowrite_flamegraph. No runtime cost in non-symbolicate builds (the dispatcher reduces to the raw path viacfg).Evidence:
cargo build -p snmalloc-rs --features profilingandcargo build -p snmalloc-rs --features profiling,symbolicateboth clean.cargo test -p snmalloc-rs --features profiling --lib35/35 pass,--features profiling,symbolicate --lib40/40 pass,--test profile_symbolize2/2 pass.cargo build -p snmalloc-toolsclean (verifies workspace consumer still builds against new API). Ticket: 86aj2dwjz. Local verification only (fork CI disabled).