Frameworks/base: Add tracing system properties

Add system properties to support zygote-started method tracing.
These are needed as the limit on system properties does not allow
the reuse of the runtime extra options system property.

Bug: 21760614
Change-Id: I3785cc5715acadbee81ef7b45081ed780f1351d3
This commit is contained in:
Andreas Gampe
2015-06-22 21:09:36 -07:00
parent 2b5bec9356
commit 98f406f6f3

View File

@@ -588,6 +588,8 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
char lockProfThresholdBuf[sizeof("-Xlockprofthreshold:")-1 + PROPERTY_VALUE_MAX];
char nativeBridgeLibrary[sizeof("-XX:NativeBridge=") + PROPERTY_VALUE_MAX];
char cpuAbiListBuf[sizeof("--cpu-abilist=") + PROPERTY_VALUE_MAX];
char methodTraceFileBuf[sizeof("-Xmethod-trace-file:") + PROPERTY_VALUE_MAX];
char methodTraceFileSizeBuf[sizeof("-Xmethod-trace-file-size:") + PROPERTY_VALUE_MAX];
bool checkJni = false;
property_get("dalvik.vm.checkjni", propBuf, "");
@@ -848,6 +850,24 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
profileMaxStackDepth,
"-Xprofile-max-stack-depth:");
/*
* Tracing options.
*/
property_get("dalvik.vm.method-trace", propBuf, "false");
if (strcmp(propBuf, "true") == 0) {
addOption("-Xmethod-trace");
parseRuntimeOption("dalvik.vm.method-trace-file",
methodTraceFileBuf,
"-Xmethod-trace-file:");
parseRuntimeOption("dalvik.vm.method-trace-file-siz",
methodTraceFileSizeBuf,
"-Xmethod-trace-file-size:");
property_get("dalvik.vm.method-trace-stream", propBuf, "false");
if (strcmp(propBuf, "true") == 0) {
addOption("-Xmethod-trace-stream");
}
}
// Native bridge library. "0" means that native bridge is disabled.
property_get("ro.dalvik.vm.native.bridge", propBuf, "");
if (propBuf[0] == '\0') {