diff options
| author | 2010-04-16 13:25:03 -0700 | |
|---|---|---|
| committer | 2010-04-16 13:25:03 -0700 | |
| commit | d5a873fbe8df67e86990969b6729db0079bbc278 (patch) | |
| tree | 18bde7f0fee66ca4462acac42c8b9be7fb512576 | |
| parent | f066611aab5758b7b2a6b4a525e3f85aa813064a (diff) | |
| parent | d8f3ec6e8308400e9446b254fcca457f6e53ea13 (diff) | |
Merge "Add command line flags to enable lock profiling." into froyo
| -rw-r--r-- | core/jni/AndroidRuntime.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 487f3d403975..6660c276e9a8 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -703,6 +703,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]; |