diff --git a/core/product.mk b/core/product.mk index ed10604490..1789561caf 100644 --- a/core/product.mk +++ b/core/product.mk @@ -395,6 +395,8 @@ _product_list_vars += PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS # supports it _product_single_value_vars += PRODUCT_ENABLE_UFFD_GC +_product_list_vars += PRODUCT_AFDO_PROFILES + .KATI_READONLY := _product_single_value_vars _product_list_vars _product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars) diff --git a/core/soong_config.mk b/core/soong_config.mk index a3961f9ed6..346edcf9ae 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -12,7 +12,15 @@ endif include $(BUILD_SYSTEM)/art_config.mk include $(BUILD_SYSTEM)/dex_preopt_config.mk +ifndef AFDO_PROFILES +# Set AFDO_PROFILES -include vendor/google_data/pgo_profile/sampling/afdo_profiles.mk +else +$(error AFDO_PROFILES can only be set from soong_config.mk. For product-specific fdo_profiles, please use PRODUCT_AFDO_PROFILES) +endif + +# PRODUCT_AFDO_PROFILES takes precedence over product-agnostic profiles in AFDO_PROFILES +ALL_AFDO_PROFILES := $(PRODUCT_AFDO_PROFILES) $(AFDO_PROFILES) ifeq ($(WRITE_SOONG_VARIABLES),true) @@ -311,7 +319,7 @@ $(call add_json_bool, IgnorePrefer32OnDevice, $(filter true,$(IGNORE_PREFER32_ON $(call add_json_list, IncludeTags, $(PRODUCT_INCLUDE_TAGS)) $(call add_json_list, SourceRootDirs, $(PRODUCT_SOURCE_ROOT_DIRS)) -$(call add_json_list, AfdoProfiles, $(PRODUCT_AFDO_PROFILES)) +$(call add_json_list, AfdoProfiles, $(ALL_AFDO_PROFILES)) $(call json_end)