From 4889c99c394159ea8e762ff2f2038fd643331fea Mon Sep 17 00:00:00 2001 From: Carmen Jackson Date: Tue, 27 Feb 2024 03:17:26 +0000 Subject: [PATCH] Use Profiling flag at build time This change puts base_system and default_art_config references to the profiling module behind the build flag. It also adds the flag to soong_config_vars so it can be referenced from the Profiling module and from platform_bootclasspath. Bug: 293957254 Bug: 325523640 Test: Built locally on trunk_food (where flag is disabled) and trunk_staging (where flag is enabled.) Ignore-AOSP-First: Must be submitted in topic with internal-only changes. Change-Id: I51cfa65ff607753cc8c588793ea381419ac99260 --- core/android_soong_config_vars.mk | 4 ++++ target/product/base_system.mk | 7 ++++++- target/product/default_art_config.mk | 16 ++++++++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index a17c7c823a..f69c147835 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -236,3 +236,7 @@ else endif # Required as platform_bootclasspath is using this namespace $(call soong_config_set,bootclasspath,release_crashrecovery_module,$(RELEASE_CRASHRECOVERY_MODULE)) + +# Enable Profiling module. Also used by platform_bootclasspath. +$(call soong_config_set,ANDROID,release_package_profiling_module,$(RELEASE_PACKAGE_PROFILING_MODULE)) +$(call soong_config_set,bootclasspath,release_package_profiling_module,$(RELEASE_PACKAGE_PROFILING_MODULE)) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 9ad93c6382..a53913209f 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -65,7 +65,6 @@ PRODUCT_PACKAGES += \ com.android.ondevicepersonalization \ com.android.os.statsd \ com.android.permission \ - com.android.profiling \ com.android.resolv \ com.android.rkpd \ com.android.neuralnetworks \ @@ -330,6 +329,12 @@ else com.android.nfcservices endif +# Check if the build supports Profiling module +ifeq ($(RELEASE_PACKAGE_PROFILING_MODULE),true) + PRODUCT_PACKAGES += \ + com.android.profiling +endif + ifeq ($(RELEASE_USE_WEBVIEW_BOOTSTRAP_MODULE),true) PRODUCT_PACKAGES += \ com.android.webview.bootstrap diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index af6e2b1c34..7084c3ad0e 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -80,7 +80,6 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.os.statsd:framework-statsd \ com.android.permission:framework-permission \ com.android.permission:framework-permission-s \ - com.android.profiling:framework-profiling \ com.android.scheduling:framework-scheduling \ com.android.sdkext:framework-sdkextensions \ com.android.tethering:framework-connectivity \ @@ -107,6 +106,13 @@ else $(call soong_config_set,bootclasspath,nfc_apex_bootclasspath_fragment,true) endif +# Check if build supports Profiling module. +ifeq ($(RELEASE_PACKAGE_PROFILING_MODULE),true) + PRODUCT_APEX_BOOT_JARS += \ + com.android.profiling:framework-profiling \ + +endif + # TODO(b/308174306): Adjust this after multiple prebuilts version is supported. # APEX boot jars that are not in prebuilt apexes. # Keep the list sorted by module names and then library names. @@ -157,12 +163,18 @@ PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS := \ com.android.btservices:service-bluetooth \ com.android.devicelock:service-devicelock \ com.android.os.statsd:service-statsd \ - com.android.profiling:service-profiling \ com.android.scheduling:service-scheduling \ com.android.tethering:service-connectivity \ com.android.uwb:service-uwb \ com.android.wifi:service-wifi \ +# Check if build supports Profiling module. +ifeq ($(RELEASE_PACKAGE_PROFILING_MODULE),true) + PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS += \ + com.android.profiling:service-profiling \ + +endif + # Overrides the (apex, jar) pairs above when determining the on-device location. The format is: # ::: PRODUCT_CONFIGURED_JAR_LOCATION_OVERRIDES := \