Skip to content

fix: use fp unwinding mode when running go test#269

Merged
GuillaumeLagrange merged 1 commit intomainfrom
cod-2335-go-flamegraph-in-dwarf-unwinding-mode-on-arm64-are-broken
Mar 19, 2026
Merged

fix: use fp unwinding mode when running go test#269
GuillaumeLagrange merged 1 commit intomainfrom
cod-2335-go-flamegraph-in-dwarf-unwinding-mode-on-arm64-are-broken

Conversation

@GuillaumeLagrange
Copy link
Contributor

Go does not produce .eh_frame sections needed for dwarf unwinding. In dwarf mode, perf captures a stack snapshot that we can use to fall back to frame pointer unwinding via framehop. However on arm64, the snapshot is missing a key register (x29/FP) due to Go's non-standard function calling convention, so the framehop fallback fails.

Using callgraph mode fp avoids this entirely: the kernel performs the unwinding itself with full access to the stack.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 18, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks


Comparing cod-2335-go-flamegraph-in-dwarf-unwinding-mode-on-arm64-are-broken (235a67a) with main (e1b20ac)

Open in CodSpeed

@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-2335-go-flamegraph-in-dwarf-unwinding-mode-on-arm64-are-broken branch from d4687ff to 90d55b4 Compare March 18, 2026 14:24
Copy link
Member

@not-matthias not-matthias left a comment

Choose a reason for hiding this comment

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

LGTM overall, maybe we can change the env var we set to directly set the unwinding mode

Go does not produce .eh_frame sections needed for dwarf unwinding.
In dwarf mode, perf captures a stack snapshot that we can use to fall
back to frame pointer unwinding via framehop. However on arm64, the
snapshot is missing a key register (x29/FP) due to Go's non-standard
function calling convention, so the framehop fallback fails.

Using callgraph mode fp avoids this entirely: the kernel performs the
unwinding itself with full access to the stack.
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-2335-go-flamegraph-in-dwarf-unwinding-mode-on-arm64-are-broken branch from 90d55b4 to 235a67a Compare March 18, 2026 22:33
@GuillaumeLagrange GuillaumeLagrange merged commit 235a67a into main Mar 19, 2026
17 checks passed
@GuillaumeLagrange GuillaumeLagrange deleted the cod-2335-go-flamegraph-in-dwarf-unwinding-mode-on-arm64-are-broken branch March 19, 2026 07:26
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