diff options
author | Andreas Gampe <agampe@google.com> | 2015-06-22 21:09:36 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2015-06-22 21:11:15 -0700 |
commit | 98f406f6f31660d0f5ee32113ffadc720b426dc6 (patch) | |
tree | b5a66b4670958ca557114842e8b46c84627e68ba /core/jni | |
parent | 2b5bec9356de159a216e5aec8d553e6da7078b72 (diff) | |
download | frameworks_base-98f406f6f31660d0f5ee32113ffadc720b426dc6.zip frameworks_base-98f406f6f31660d0f5ee32113ffadc720b426dc6.tar.gz frameworks_base-98f406f6f31660d0f5ee32113ffadc720b426dc6.tar.bz2 |
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
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 2c35a8b..bffbab7 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -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') { |