diff options
| author | 2014-07-08 10:00:56 -0700 | |
|---|---|---|
| committer | 2014-07-08 10:00:56 -0700 | |
| commit | 997660dec8b10bba56276f35a9ee8d7ce9d62fc2 (patch) | |
| tree | 61750b5f918699c717ae3ad9df93dd93ebbf2f67 | |
| parent | 50dffeee9c8f7d3f396ffde30bd6b733e1af72d3 (diff) | |
Adds PGO_GEN and PGO_USE for libart and libart-compiler.
PGO_GEN=device_path is used to build an instrumented binary. The profile will be stored in the specified path in device.
PGO_USE=host_path is used to build an PGO-optimized binary. The profile should be pre-stored in the specified path in host.
Bug: 16153819
Change-Id: Ib56f8707df009f290608ca66f669db06e65815c1
| -rw-r--r-- | build/Android.common_build.mk | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk index 5cfdbfd816..c39bc5dd63 100644 --- a/build/Android.common_build.mk +++ b/build/Android.common_build.mk @@ -207,6 +207,7 @@ ifndef LIBART_IMG_TARGET_BASE_ADDRESS $(error LIBART_IMG_TARGET_BASE_ADDRESS unset) endif ART_TARGET_CFLAGS := $(art_cflags) -DART_TARGET -DART_BASE_ADDRESS=$(LIBART_IMG_TARGET_BASE_ADDRESS) +ART_TARGET_LDFLAGS := ifeq ($(TARGET_CPU_SMP),true) ART_TARGET_CFLAGS += -DANDROID_SMP=1 else @@ -219,6 +220,14 @@ else endif endif ART_TARGET_CFLAGS += $(ART_DEFAULT_GC_TYPE_CFLAGS) +ifdef PGO_GEN + ART_TARGET_CFLAGS += -fprofile-generate=$(PGO_GEN) + ART_TARGET_LDFLAGS += -fprofile-generate=$(PGO_GEN) +endif +ifdef PGO_USE + ART_TARGET_CFLAGS += -fprofile-use=$(PGO_USE) + ART_TARGET_CFLAGS += -fprofile-correction -Wno-error +endif # DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES is set in ../build/core/dex_preopt.mk based on # the TARGET_CPU_VARIANT @@ -277,6 +286,7 @@ ART_TARGET_DEBUG_CFLAGS := $(art_debug_cflags) define set-target-local-cflags-vars LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) LOCAL_CFLAGS_x86 += $(ART_TARGET_CFLAGS_x86) + LOCAL_LDFLAGS += $(ART_TARGET_LDFLAGS) art_target_cflags_ndebug_or_debug := $(1) ifeq ($$(art_target_cflags_ndebug_or_debug),debug) LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |