summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2019-08-24 01:48:15 -0700
committer android-build-merger <android-build-merger@google.com> 2019-08-24 01:48:15 -0700
commit9d5b85a5ec226c30835e37bb72f1dcfc495d6205 (patch)
tree6e94d2b794282a68669dd6cdce4e276bb1da34b5
parent28bde2ffbb73c428661d3dc22608719de78bd1dd (diff)
parentfb1e55116c3ebd06a1c1ca2b140c77fe5db44c23 (diff)
Merge "Add phenotype property for enabling profiling of boot class path" am: eb247e7abf am: d5f1fed45f
am: fb1e55116c Change-Id: I91644286c178da18733a8cf3acaa0881b77c9b72
-rw-r--r--core/jni/AndroidRuntime.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 1d1a27d10ae3..7df621daea13 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -245,6 +245,9 @@ static const char* kGenerationalCCRuntimeOption = "-Xgc:generational_cc";
// Copying (CC) garbage collector.
static const char* kNoGenerationalCCRuntimeOption = "-Xgc:nogenerational_cc";
+// Phenotype property name for enabling profiling the boot class path.
+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.
@@ -690,6 +693,24 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool p
char jdwpProviderBuf[sizeof("-XjdwpProvider:") - 1 + PROPERTY_VALUE_MAX];
char bootImageBuf[sizeof("-Ximage:") - 1 + PROPERTY_VALUE_MAX];
+ // Read if we are using the profile configuration, do this at the start since the last ART args
+ // take precedence.
+ property_get("dalvik.vm.profilebootclasspath", propBuf, "");
+ std::string profile_boot_class_path = propBuf;
+ // Empty means the property is unset and we should default to the phenotype property.
+ // The possible values are {"true", "false", ""}
+ if (profile_boot_class_path.empty()) {
+ profile_boot_class_path = server_configurable_flags::GetServerConfigurableFlag(
+ RUNTIME_NATIVE_BOOT_NAMESPACE,
+ PROFILE_BOOT_CLASS_PATH,
+ /*default_value=*/ "");
+ }
+ if (profile_boot_class_path == "true") {
+ addOption("-Xps-profile-boot-class-path");
+ addOption("-Xps-profile-aot-code");
+ addOption("-Xjitsaveprofilinginfo");
+ }
+
std::string use_apex_image =
server_configurable_flags::GetServerConfigurableFlag(RUNTIME_NATIVE_BOOT_NAMESPACE,
ENABLE_APEX_IMAGE,
@@ -807,13 +828,6 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool p
parseRuntimeOption("dalvik.vm.jittransitionweight",
jittransitionweightOptBuf,
"-Xjittransitionweight:");
-
- property_get("dalvik.vm.profilebootimage", propBuf, "");
- if (strcmp(propBuf, "true") == 0) {
- addOption("-Xps-profile-boot-class-path");
- addOption("-Xps-profile-aot-code");
- }
-
/*
* Madvise related options.
*/