Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5eee004b authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Add system property for hot startup method threshold

The property is dalvik.vm.hot-startup-method-samples, setting this
controls how many startup samples are required before methods are
marked as hot in the profile.

Test: adb shell setprop dalvik.vm.hot-startup-method-samples 12
Test: adb shell setprop dalvik.vm.extra-opts -verbose:profiler
Test: adb logcat | grep Profile

Bug: 36457259

Change-Id: If8e37a160802a00fb44f0c243fb358df02104741
parent 28f6dc95
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -613,6 +613,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
    char useJitProfilesOptsBuf[sizeof("-Xjitsaveprofilinginfo:")-1 + PROPERTY_VALUE_MAX];
    char jitprithreadweightOptBuf[sizeof("-Xjitprithreadweight:")-1 + PROPERTY_VALUE_MAX];
    char jittransitionweightOptBuf[sizeof("-Xjittransitionweight:")-1 + PROPERTY_VALUE_MAX];
    char hotstartupsamplesOptsBuf[sizeof("-Xps-hot-startup-method-samples:")-1 + PROPERTY_VALUE_MAX];
    char gctypeOptsBuf[sizeof("-Xgc:")-1 + PROPERTY_VALUE_MAX];
    char backgroundgcOptsBuf[sizeof("-XX:BackgroundGC=")-1 + PROPERTY_VALUE_MAX];
    char heaptargetutilizationOptsBuf[sizeof("-XX:HeapTargetUtilization=")-1 + PROPERTY_VALUE_MAX];
@@ -739,6 +740,12 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
                       jittransitionweightOptBuf,
                       "-Xjittransitionweight:");

    /*
     * Profile related options.
     */
    parseRuntimeOption("dalvik.vm.hot-startup-method-samples", hotstartupsamplesOptsBuf,
            "-Xps-hot-startup-method-samples:");

    property_get("ro.config.low_ram", propBuf, "");
    if (strcmp(propBuf, "true") == 0) {
      addOption("-XX:LowMemoryMode");