diff options
author | Cherry Mui <cherryyz@google.com> | 2022-10-03 19:07:39 -0400 |
---|---|---|
committer | Cherry Mui <cherryyz@google.com> | 2022-11-16 22:12:54 +0000 |
commit | 32851587d1adeb07503c2b6168ab11f008972606 (patch) | |
tree | 260b3deeff16a3fc909b672ec31c43c1328548fd /src/cmd/go/alldocs.go | |
parent | 17de9e2d18a62e28bb8032b04d81835e7705d4c7 (diff) | |
download | go-32851587d1adeb07503c2b6168ab11f008972606.tar.gz go-32851587d1adeb07503c2b6168ab11f008972606.zip |
cmd/go: add PGO auto mode
Add "auto" mode for the -pgo build flag. When -pgo=auto is
specified, if there is a default.pgo file in the directory of the
main package, it will be selected and used for the build.
Currently it requires exactly one main package when -pgo=auto is
specified. (We'll support multiple main packages in the future.)
Also apply to other build-related subcommands, "go install", "go
run", "go test", and "go list".
For #55022.
Change-Id: Iab7974ab8932daf0e83506de505e044a8e412466
Reviewed-on: https://go-review.googlesource.com/c/go/+/438737
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/alldocs.go')
-rw-r--r-- | src/cmd/go/alldocs.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index d493ecc726..9079fa5f7b 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -202,6 +202,8 @@ // run through go run and go test respectively. // -pgo file // specify the file path of a profile for profile-guided optimization (PGO). +// Special name "auto" lets the go command select a file named +// "default.pgo" in the main package's directory if that file exists. // Special name "off" turns off PGO. // -pkgdir dir // install and load all packages from dir instead of the usual locations. |