Commit 6ae610c
authored
fix(pgo): skip re-symbolization when merging pprof profiles (#2407)
## 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.)1 parent 19a2907 commit 6ae610c
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
0 commit comments