From 60ee4a34aa542005901114b8bfe8b891b3873f38 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 6 Oct 2022 14:06:22 -0400 Subject: [PATCH] Add support for PGO builds (fixes issue #2956) This configuration applies to Official Release builds only. Chromium currently provides PGO profiles for Windows x86/x64, MacOS x64/ARM64 and Linux x64. Official builds for these platforms must run automate-git.py with the `--with-pgo-profiles` command-line flag. Official builds for other platforms must disable PGO builds by adding `chrome_pgo_phase=0` to GN_DEFINES. --- tools/automate/automate-git.py | 9 +++++++++ tools/gn_args.py | 6 ------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/automate/automate-git.py b/tools/automate/automate-git.py index f243afc5f..fd799f80e 100644 --- a/tools/automate/automate-git.py +++ b/tools/automate/automate-git.py @@ -809,6 +809,12 @@ parser.add_option( dest='arm64build', default=False, help='Create an ARM64 build.') +parser.add_option( + '--with-pgo-profiles', + action='store_true', + dest='withpgoprofiles', + default=False, + help='Download PGO profiles for the build.') # Test-related options. parser.add_option( @@ -1261,6 +1267,9 @@ if not os.path.exists(gclient_file) or options.forceconfig: "'managed': False,"+\ "'name': 'src', "+\ "'url': '" + chromium_url + "', "+\ + "'custom_vars': {"+\ + "'checkout_pgo_profiles': " + ('True' if options.withpgoprofiles else 'False') + ", "+\ + "}, "+\ "'custom_deps': {"+\ "'build': None, "+\ "'build/scripts/command_wrapper/bin': None, "+\ diff --git a/tools/gn_args.py b/tools/gn_args.py index 15afb5fcc..b670941bc 100644 --- a/tools/gn_args.py +++ b/tools/gn_args.py @@ -212,12 +212,6 @@ def GetRecommendedDefaultArgs(): # distribution. 'is_component_build': False, - # Specify the current PGO phase. Default is 0 (turned off) for normal - # builds and 2 (used during the optimization phase) for official Windows - # and macOS builds. Currently turned off for CEF because it requires - # additional setup and is not yet tested. See issue #2956. - 'chrome_pgo_phase': 0, - # Disable support for background apps, which don't make sense with CEF. # Default is enabled on desktop platforms. This feature was also causing # strange shutdown crashes when using the Chrome runtime with a Debug