Add command line flags to enable lock profiling.

Change-Id: I5d1b5296020899c1af6ba5d93cece48f12173d2d
This commit is contained in:
Carl Shapiro
2010-04-12 16:31:59 -07:00
parent 1477798b4f
commit cead9ca9de

View File

@@ -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];