Skip to content

Commit 64519ba

Browse files
committed
cmd/compile/internal/pgo: add hint to missing start_line error
Profiles only began adding Function.start_line in 1.20. If it is missing, add a hint to the error message that they may need to profile a build of the application built with a newer version of the toolchain. Technically profiles are not required to come from Go itself (e.g., they could be converted from perf), but in practice they most likely are. Fixes #57674. Change-Id: I87eca126d3fed0cff94bbb8dd748bd4652f88b12 Reviewed-on: https://go-review.googlesource.com/c/go/+/461195 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Run-TryBot: Michael Pratt <[email protected]>
1 parent 376076f commit 64519ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/compile/internal/pgo/irgraph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (p *Profile) processprofileGraph(g *Graph) bool {
217217
// TODO(prattic): If Function.start_line is missing we could
218218
// fall back to using absolute line numbers, which is better
219219
// than nothing.
220-
log.Fatal("PGO profile missing Function.start_line data")
220+
log.Fatal("PGO profile missing Function.start_line data (Go version of profiled application too old? Go 1.20+ automatically adds this to profiles)")
221221
}
222222

223223
return true

0 commit comments

Comments
 (0)