From 9ac03a050485242c5b511898000007f1030b05bf Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 7 Feb 2020 11:54:18 +0000 Subject: [PATCH] Use new image location for JIT Zygote. Bug:119800099 Test: boots, correct image is being picked up, correct files are being pinned Change-Id: I7add3006b0d72b005daabb6609d954b466985304 --- core/jni/AndroidRuntime.cpp | 22 ++++++++++--------- core/res/res/values/config.xml | 4 ++-- core/res/res/values/symbols.xml | 2 +- .../com/android/server/PinnerService.java | 7 +++--- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 657336e6910a6..56167cdf15a4f 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -209,9 +209,11 @@ static const char* kNoGenerationalCCRuntimeOption = "-Xgc:nogenerational_cc"; static const char* PROFILE_BOOT_CLASS_PATH = "profilebootclasspath"; // Feature flag name for running the JIT in Zygote experiment, b/119800099. -static const char* ENABLE_APEX_IMAGE = "enable_apex_image"; -// Flag to pass to the runtime when using the apex image. -static const char* kApexImageOption = "-Ximage:/system/framework/apex.art"; +// TODO: Rename the server-level flag or remove. +static const char* ENABLE_JITZYGOTE_IMAGE = "enable_apex_image"; +// Flag to pass to the runtime when using the JIT Zygote image. +static const char* kJitZygoteImageOption = + "-Ximage:boot.art:/nonx/boot-framework.art!/system/etc/boot-image.prof"; // Feature flag name for disabling lock profiling. static const char* DISABLE_LOCK_PROFILING = "disable_lock_profiling"; @@ -687,16 +689,16 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool p addOption("-Xjitsaveprofilinginfo"); } - std::string use_apex_image_flag = - server_configurable_flags::GetServerConfigurableFlag(RUNTIME_NATIVE_BOOT_NAMESPACE, - ENABLE_APEX_IMAGE, - /*default_value=*/ ""); + std::string use_jitzygote_image_flag = + server_configurable_flags::GetServerConfigurableFlag(RUNTIME_NATIVE_BOOT_NAMESPACE, + ENABLE_JITZYGOTE_IMAGE, + /*default_value=*/""); // Use the APEX boot image for boot class path profiling to get JIT samples on BCP methods. // Also use the APEX boot image if it's explicitly enabled via configuration flag. - const bool use_apex_image = profile_boot_class_path || (use_apex_image_flag == "true"); + const bool use_apex_image = profile_boot_class_path || (use_jitzygote_image_flag == "true"); if (use_apex_image) { - addOption(kApexImageOption); - ALOGI("Using Apex boot image: '%s'\n", kApexImageOption); + ALOGI("Using JIT Zygote image: '%s'\n", kJitZygoteImageOption); + addOption(kJitZygoteImageOption); } else if (parseRuntimeOption("dalvik.vm.boot-image", bootImageBuf, "-Ximage:")) { ALOGI("Using dalvik.vm.boot-image: '%s'\n", bootImageBuf); } else { diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 31e68e88c0a85..f17cd45cd880d 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3402,8 +3402,8 @@ false - - + +