From 6e9388fd0c32213a6a3a8406051d6bebfb08dc17 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 23 Jun 2017 14:47:56 -0700 Subject: [PATCH] Add PRODUCT_SYSTEM_SERVER_DEBUG_INFO property Used for specifying if a product should get system server mini debug info. Defaults to true. Can be disabled by doing PRODUCT_SYSTEM_SERVER_DEBUG_INFO := false The property overrides WITH_DEXPREOPT_DEBUG_INFO, so if PRODUCT_SYSTEM_SERVER_DEBUG_INFO is true but WITH_DEXPREOPT_DEBUG_INFO is false, system server will have mini debug info. (cherry picked from commit 94f5f93236bf6743be674b34ae9cf04a4282bf5c) Bug: 62862291 Test: make Merged-In: I189cd144ce3ade5f02855db022874c8dd45cbdf3 Change-Id: I189cd144ce3ade5f02855db022874c8dd45cbdf3 --- core/dex_preopt_odex_install.mk | 15 +++++++++++++++ core/product.mk | 1 + core/product_config.mk | 2 ++ 3 files changed, 18 insertions(+) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 76d56c05b..136def470 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -201,6 +201,21 @@ ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS))) endif endif +# PRODUCT_SYSTEM_SERVER_DEBUG_INFO overrides WITH_DEXPREOPT_DEBUG_INFO. +my_system_server_debug_info := $(PRODUCT_SYSTEM_SERVER_DEBUG_INFO) +ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT))) +# Only enable for non-eng builds. +ifeq (,$(my_system_server_debug_info)) +my_system_server_debug_info := true +endif +endif + +ifeq (true, $(my_system_server_debug_info)) + ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS),$(LOCAL_MODULE))) + LOCAL_DEX_PREOPT_FLAGS += --generate-mini-debug-info + endif +endif + $(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS) $(built_vdex): $(built_odex) $(built_art): $(built_odex) diff --git a/core/product.mk b/core/product.mk index a3e8a8044..590148f0d 100644 --- a/core/product.mk +++ b/core/product.mk @@ -120,6 +120,7 @@ _product_var_list := \ PRODUCT_VERITY_SIGNING_KEY \ PRODUCT_SYSTEM_VERITY_PARTITION \ PRODUCT_VENDOR_VERITY_PARTITION \ + PRODUCT_SYSTEM_SERVER_DEBUG_INFO \ PRODUCT_DEX_PREOPT_MODULE_CONFIGS \ PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \ PRODUCT_DEX_PREOPT_BOOT_FLAGS \ diff --git a/core/product_config.mk b/core/product_config.mk index 12709c2ee..4c3824a69 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -385,6 +385,8 @@ PRODUCT_DEX_PREOPT_PROFILE_DIR := \ PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)) +PRODUCT_SYSTEM_SERVER_DEBUG_INFO := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_DEBUG_INFO)) # Resolve and setup per-module dex-preopt configs. PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \