Merge "Use new image location for JIT Zygote."

This commit is contained in:
Nicolas Geoffray
2020-02-09 22:47:09 +00:00
committed by Android (Google) Code Review
4 changed files with 19 additions and 16 deletions

View File

@@ -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";
@@ -689,16 +691,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 {

View File

@@ -3402,8 +3402,8 @@
<!-- True if assistant app should be pinned via Pinner Service -->
<bool name="config_pinnerAssistantApp">false</bool>
<!-- List of files pinned by the Pinner Service with the apex boot image b/119800099 -->
<string-array translatable="false" name="config_apexBootImagePinnerServiceFiles">
<!-- List of files pinned by the Pinner Service with the JIT Zygote boot image b/119800099 -->
<string-array translatable="false" name="config_jitzygoteBootImagePinnerServiceFiles">
</string-array>
<!-- Number of days preloaded file cache should be preserved on a device before it can be

View File

@@ -3037,7 +3037,7 @@
<java-symbol type="bool" name="config_pinnerCameraApp" />
<java-symbol type="bool" name="config_pinnerHomeApp" />
<java-symbol type="bool" name="config_pinnerAssistantApp" />
<java-symbol type="array" name="config_apexBootImagePinnerServiceFiles" />
<java-symbol type="array" name="config_jitzygoteBootImagePinnerServiceFiles" />
<java-symbol type="string" name="config_doubleTouchGestureEnableFile" />

View File

@@ -272,10 +272,11 @@ public final class PinnerService extends SystemService {
private void handlePinOnStart() {
final String bootImage = SystemProperties.get("dalvik.vm.boot-image", "");
String[] filesToPin = null;
if (bootImage.endsWith("apex.art")) {
// Use the files listed for that specific boot image
if (bootImage.endsWith("boot-image.prof")) {
// Use the files listed for that specific boot image.
// TODO: find a better way to know we're using the JIT zygote configuration.
filesToPin = mContext.getResources().getStringArray(
com.android.internal.R.array.config_apexBootImagePinnerServiceFiles);
com.android.internal.R.array.config_jitzygoteBootImagePinnerServiceFiles);
} else {
// Files to pin come from the overlay and can be specified per-device config
filesToPin = mContext.getResources().getStringArray(