Skip to content

fix(pgo): skip re-symbolization when merging pprof profiles#2407

Merged
dunglas merged 1 commit into
mainfrom
fix/pgo-merge-symbolize-none
May 13, 2026
Merged

fix(pgo): skip re-symbolization when merging pprof profiles#2407
dunglas merged 1 commit into
mainfrom
fix/pgo-merge-symbolize-none

Conversation

@dunglas
Copy link
Copy Markdown
Member

@dunglas dunglas commented May 13, 2026

Summary

The PGO refresh workflow at https://github.com/php/frankenphp/actions/runs/25779871543/job/75719971682 (and the two prior runs - the job has never succeeded) failed when building frankenphp-pgo with:

preprofile: error parsing profile: profile missing Function.start_line data (Go version of profiled application too old? Go 1.20+ automatically adds this to profiles)

The two input profiles produced by net/http/pprof already carry Function.start_line (Go 1.20+ guarantees this). The problem is the merge step itself:

pprof -proto regular.pgo worker.pgo > default.pgo

pprof -proto runs local symbolization by default. On the CI runner that falls back to addr2line, whose adapter in https://github.com/google/pprof/blob/main/internal/binutils/addr2liner.go constructs plugin.Frame with only Func, File, and Line. StartLine is never set, so the new Function records that replace the original symbolized ones come out with start_line = 0, which Go PGO's preprofile rejects.

pprof -symbolize=none skips that step so the already-symbolized records from net/http/pprof survive the merge intact. (The PGO Tools wiki notes that pprof "should produce a PGO-compatible output" only when its symbolization preserves metadata - that's true with llvm-symbolizer's JSON path added in google/pprof#891, but not with the addr2line fallback used in CI.)

Copilot AI review requested due to automatic review settings May 13, 2026 08:44
Copy link
Copy Markdown
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

Fixes the PGO profile merge step to avoid pprof re-symbolization that can drop Function.start_line and cause Go’s preprofile to reject the merged profile when building frankenphp-pgo.

Changes:

  • Add -symbolize=none to the pprof -proto merge invocation to preserve existing function metadata.
  • Document why re-symbolization is avoided, referencing the upstream google/pprof issue.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pprof -proto re-symbolized the merged profile and produced Function
records without start_line, which Go PGO's preprofile rejects with
"profile missing Function.start_line data" (google/pprof#823). Pass
-symbolize=none so the already-symbolized input from net/http/pprof
is preserved.
@dunglas dunglas force-pushed the fix/pgo-merge-symbolize-none branch from ccf7fe5 to bd537b3 Compare May 13, 2026 08:50
@dunglas dunglas merged commit 6ae610c into main May 13, 2026
92 of 93 checks passed
@dunglas dunglas deleted the fix/pgo-merge-symbolize-none branch May 13, 2026 08:52
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