diff options
author | Mathieu Chartier <mathieuc@google.com> | 2017-03-04 02:21:23 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-03-04 02:21:24 +0000 |
commit | b05880e3112745d080331874f65dd4683d158880 (patch) | |
tree | aebb11934022fc676b6431da5788c8ac2a982b10 | |
parent | a57a2fd11899cb2497be66cc662dd5eae98d27b1 (diff) | |
parent | 2ac264fe138052bb277451e1a44c4eeef6fb0714 (diff) | |
download | platform_build-b05880e3112745d080331874f65dd4683d158880.tar.gz platform_build-b05880e3112745d080331874f65dd4683d158880.tar.bz2 platform_build-b05880e3112745d080331874f65dd4683d158880.zip |
Merge "Move profile logic to dex_preopt_odex_install"
-rw-r--r-- | core/dex_preopt_odex_install.mk | 32 | ||||
-rw-r--r-- | core/setup_one_odex.mk | 28 |
2 files changed, 32 insertions, 28 deletions
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 9a15706bd5..269a61f837 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -113,6 +113,38 @@ installed_vdex := $(strip $(installed_vdex)) installed_art := $(strip $(installed_art)) ifdef built_odex + +ifndef LOCAL_DEX_PREOPT_GENERATE_PROFILE +ifeq (true,$(WITH_DEX_PREOPT_GENERATE_PROFILE)) + LOCAL_DEX_PREOPT_GENERATE_PROFILE := true +endif +endif + +ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) +ifndef LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING +$(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)) +endif +my_built_profile := $(dir $(LOCAL_BUILT_MODULE))/profile.prof +my_dex_location := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE)) +$(built_odex): $(my_built_profile) +$(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := --profile-file=$(my_built_profile) +$(my_built_profile): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE) +$(my_built_profile): PRIVATE_DEX_LOCATION := $(my_dex_location) +$(my_built_profile): PRIVATE_SOURCE_CLASSES := $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) +$(my_built_profile): $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) +$(my_built_profile): $(PROFMAN) +$(my_built_profile): $(PRIVATE_INSTALLED_MODULE) +$(my_built_profile): + $(hide) mkdir -p $(dir $@) + ANDROID_LOG_TAGS="*:e" $(PROFMAN) \ + --create-profile-from=$(PRIVATE_SOURCE_CLASSES) \ + --apk=$(PRIVATE_INSTALLED_MODULE) \ + --dex-location=$(PRIVATE_DEX_LOCATION) \ + --reference-profile-file=$@ +else +$(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := +endif + ifndef LOCAL_DEX_PREOPT_FLAGS LOCAL_DEX_PREOPT_FLAGS := $(DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG) ifndef LOCAL_DEX_PREOPT_FLAGS diff --git a/core/setup_one_odex.mk b/core/setup_one_odex.mk index 8528c9af63..f0ffe81e62 100644 --- a/core/setup_one_odex.mk +++ b/core/setup_one_odex.mk @@ -55,34 +55,6 @@ installed_art += $(my_installed_art) built_installed_art += $(my_built_art):$(my_installed_art) endif -ifndef LOCAL_DEX_PREOPT_GENERATE_PROFILE -ifeq (true,$(WITH_DEX_PREOPT_GENERATE_PROFILE)) - LOCAL_DEX_PREOPT_GENERATE_PROFILE := true -endif -endif - -ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) -ifndef LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING -$(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)) -endif -my_built_profile := $(dir $(my_built_odex))../../$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH).prof -my_dex_location := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE)) -$(my_built_odex): $(my_built_profile) -$(my_built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := --profile-file=$(my_built_profile) -$(my_built_profile): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE) -$(my_built_profile): PRIVATE_DEX_LOCATION := $(my_dex_location) -$(my_built_profile): PRIVATE_SOURCE_CLASSES := $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) -$(my_built_profile): $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) -$(my_built_profile): $(PROFMAN) -$(my_built_profile): $(PRIVATE_INSTALLED_MODULE) -$(my_built_profile): - ANDROID_LOG_TAGS="*:e" $(PROFMAN) \ - --create-profile-from=$(PRIVATE_SOURCE_CLASSES) \ - --apk=$(PRIVATE_INSTALLED_MODULE) \ - --dex-location=$(PRIVATE_DEX_LOCATION) \ - --reference-profile-file=$@ -endif - $(eval $(call copy-one-file,$(my_built_odex),$(my_installed_odex))) $(eval $(call copy-one-file,$(my_built_vdex),$(my_installed_vdex))) |