Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebce4960 authored by Vinh Tran's avatar Vinh Tran
Browse files

Split PRODUCT_AFDO_PROFILES into two variables

Currently, PRODUCT_AFDO_PROFILES is generally applied to all products and is not semantically treated as a product config varilable.

Splitting this allows us:
1. Explicitly tell that PRODUCT_AFDO_PROFILES takes precedence over product-agnostic profiles in AFDO_PROFILES
2. Add PRODUCT_AFDO_PROFILES to _product_vars_list

Ignore-AOSP-First: ag/22604900 in the same topic is in internal repo
Test: Define PRODUCT_AFDO_PROFILES in a product config and make sure it appears first in the soong var AfdoProfiles
Bug: 277215393
Change-Id: I284f6308d456994bb72129cb0d7be7cd091993ae
parent d8448852
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)

+9 −1
Original line number Diff line number Diff line
@@ -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)