feature: flamegraph dwarf data optional#668
Merged
harp-intel merged 2 commits intomainfrom Mar 20, 2026
Merged
Conversation
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes DWARF-based native stack collection optional for the perfspect flamegraph command to prevent very large profiles on busy systems, while still allowing users to opt into higher-fidelity unwinding when needed.
Changes:
- Adds a new
--dual-native-stacksflag to optionally capture a second native profile using DWARF unwinding. - Updates the flamegraph collection script to conditionally run DWARF
perf recordand to streamperf scriptdirectly intostackcollapse-perfto avoid large intermediate files. - Updates flamegraph documentation and README to describe the new option and its tradeoffs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
internal/script/scripts.go |
Adds dual_native_stacks parameter, gates DWARF perf recording, and changes perf collapse to use pipes (no intermediate stack files). |
cmd/flamegraph/flamegraph.go |
Introduces --dual-native-stacks flag and passes it into the flamegraph script params. |
docs/perfspect_flamegraph.md |
Documents the new CLI flag in the flamegraph help output. |
README.md |
Notes default frame-pointer behavior and describes what --dual-native-stacks does. |
- Updated the collapse_perf_data function to use 'set -o pipefail' for both perf_fp_data and perf_dwarf_data commands, improving error detection in the pipeline. - This change ensures that any failure in the command pipeline will be caught, enhancing the robustness of the profiling script. Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
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.
On a busy system, data collected for the flamegraph in dwarf mode grows very large very quickly. This change adds a flamegraph option to enable collection of dwarf mode data with a new flag.