Skip to content

feature: flamegraph dwarf data optional#668

Merged
harp-intel merged 2 commits intomainfrom
feature/flamegraph_dwarf_optional
Mar 20, 2026
Merged

feature: flamegraph dwarf data optional#668
harp-intel merged 2 commits intomainfrom
feature/flamegraph_dwarf_optional

Conversation

@harp-intel
Copy link
Contributor

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.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-stacks flag to optionally capture a second native profile using DWARF unwinding.
  • Updates the flamegraph collection script to conditionally run DWARF perf record and to stream perf script directly into stackcollapse-perf to 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>
@harp-intel harp-intel merged commit 5c98be7 into main Mar 20, 2026
5 checks passed
@harp-intel harp-intel deleted the feature/flamegraph_dwarf_optional branch March 20, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants