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

Commit a3e259e8 authored by Carl Shapiro's avatar Carl Shapiro Committed by Android (Google) Code Review
Browse files

Merge "Add command line flags to enable lock profiling."

parents 6ff9d513 cead9ca9
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -702,6 +702,24 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
        //mOptions.add(opt);
    }

    char lockProfThresholdBuf[sizeof("-Xlockprofthreshold:") + sizeof(propBuf)];
    property_get("dalvik.vm.lockprof.threshold", propBuf, "");
    if (strlen(propBuf) > 0) {
      strcpy(lockProfThresholdBuf, "-Xlockprofthreshold:");
      strcat(lockProfThresholdBuf, propBuf);
      opt.optionString = lockProfThresholdBuf;
      mOptions.add(opt);
    }

    char lockProfSampleBuf[sizeof("-Xlockprofsample:") + sizeof(propBuf)];
    property_get("dalvik.vm.lockprof.sample", propBuf, "");
    if (strlen(propBuf) > 0) {
      strcpy(lockProfSampleBuf, "-Xlockprofsample:");
      strcat(lockProfSampleBuf, propBuf);
      opt.optionString = lockProfSampleBuf;
      mOptions.add(opt);
    }

#if defined(WITH_JIT)
    /* Minimal profile threshold to trigger JIT compilation */
    char jitThresholdBuf[sizeof("-Xjitthreshold:") + PROPERTY_VALUE_MAX];