Install preopted profiles on device

They are stored in /system/etc/profiles/, these will be copied to
the over the data profiles during fist boot. This means is required
to avoid missing JIT samples for the preopt compiled methods.

(cherry picked from commit 44c9c076d3)

Bug: 38032017

Test: make and flash
Test: adb shell ls -l /system/etc/profiles/

Merged-In: Ia4573464ac39c4720e0d9e8a29b8ea4213bd9d78
Change-Id: Ia4573464ac39c4720e0d9e8a29b8ea4213bd9d78
This commit is contained in:
Mathieu Chartier 2017-05-09 19:17:33 -07:00 committed by Andreas Gampe
parent fcc8d8b26d
commit 98f44b7f20

View file

@ -64,6 +64,11 @@ ifeq (false,$(WITH_DEX_PREOPT_GENERATE_PROFILE))
LOCAL_DEX_PREOPT_GENERATE_PROFILE := false
endif
ifdef LOCAL_VENDOR_MODULE
ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE))
$(error profiles are not supported for vendor modules)
endif
else
ifndef LOCAL_DEX_PREOPT_GENERATE_PROFILE
# If LOCAL_DEX_PREOPT_GENERATE_PROFILE is not defined, default it based on the existence of the
# profile class listing. TODO: Use product specific directory here.
@ -77,6 +82,7 @@ endif
LOCAL_DEX_PREOPT_GENERATE_PROFILE := true
endif
endif
endif
dexpreopt_boot_jar_module := $(filter $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE))
ifdef dexpreopt_boot_jar_module
@ -153,7 +159,12 @@ $(my_built_profile):
--apk=$(PRIVATE_BUILT_MODULE) \
--dex-location=$(PRIVATE_DEX_LOCATION) \
--reference-profile-file=$@
my_installed_profile := $(LOCAL_INSTALLED_MODULE).prof
$(eval $(call copy-one-file,$(my_built_profile),$(my_installed_profile)))
build_installed_profile:=$(my_built_profile):$(my_installed_profile)
else
build_installed_profile:=
my_installed_profile :=
$(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS :=
endif
@ -189,9 +200,11 @@ endif
ALL_MODULES.$(my_register_name).INSTALLED += $(installed_odex)
ALL_MODULES.$(my_register_name).INSTALLED += $(installed_vdex)
ALL_MODULES.$(my_register_name).INSTALLED += $(installed_art)
ALL_MODULES.$(my_register_name).INSTALLED += $(my_installed_profile)
ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_odex)
ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_vdex)
ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_art)
ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(build_installed_profile)
# Record dex-preopt config.
DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT := $(LOCAL_DEX_PREOPT)
@ -207,6 +220,6 @@ DEXPREOPT.MODULES.$(LOCAL_MODULE_CLASS) := $(sort \
# Make sure to install the .odex and .vdex when you run "make <module_name>"
$(my_all_targets): $(installed_odex) $(installed_vdex) $(installed_art)
$(my_all_targets): $(installed_odex) $(installed_vdex) $(installed_art) $(my_installed_profile)
endif # LOCAL_DEX_PREOPT