diff options
| author | 2017-01-25 00:35:21 -0800 | |
|---|---|---|
| committer | 2017-01-25 10:40:46 -0800 | |
| commit | ca6e14ebd19ab972e4962f18d99a882969d7bee1 (patch) | |
| tree | 9bd4bc18fcc56294e01db0ad4e551b13ae533fea /runtime/native/dalvik_system_VMDebug.cc | |
| parent | 67edcfdb2151af66cdacf61e44c618c41601d0c8 (diff) | |
[ART] Prepare profile streaming for framework to use.
Make it possible for framework's Java code to optionally
enable streaming output of profile.
Test: m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host
Change-Id: I70f6cf3b72c6cec2ac1f1f1e9c2b2c4727d72e8a
Diffstat (limited to 'runtime/native/dalvik_system_VMDebug.cc')
| -rw-r--r-- | runtime/native/dalvik_system_VMDebug.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc index 67b2e1c503..0d24587998 100644 --- a/runtime/native/dalvik_system_VMDebug.cc +++ b/runtime/native/dalvik_system_VMDebug.cc @@ -90,7 +90,8 @@ static void VMDebug_startMethodTracingDdmsImpl(JNIEnv*, jclass, jint bufferSize, static void VMDebug_startMethodTracingFd(JNIEnv* env, jclass, jstring javaTraceFilename, jobject javaFd, jint bufferSize, jint flags, - jboolean samplingEnabled, jint intervalUs) { + jboolean samplingEnabled, jint intervalUs, + jboolean streamingOutput) { int originalFd = jniGetFDFromFileDescriptor(env, javaFd); if (originalFd < 0) { return; @@ -108,7 +109,10 @@ static void VMDebug_startMethodTracingFd(JNIEnv* env, jclass, jstring javaTraceF if (traceFilename.c_str() == nullptr) { return; } - Trace::Start(traceFilename.c_str(), fd, bufferSize, flags, Trace::TraceOutputMode::kFile, + Trace::TraceOutputMode outputMode = streamingOutput + ? Trace::TraceOutputMode::kStreaming + : Trace::TraceOutputMode::kFile; + Trace::Start(traceFilename.c_str(), fd, bufferSize, flags, outputMode, samplingEnabled ? Trace::TraceMode::kSampling : Trace::TraceMode::kMethodTracing, intervalUs); } @@ -547,7 +551,7 @@ static JNINativeMethod gMethods[] = { NATIVE_METHOD(VMDebug, startEmulatorTracing, "()V"), NATIVE_METHOD(VMDebug, startInstructionCounting, "()V"), NATIVE_METHOD(VMDebug, startMethodTracingDdmsImpl, "(IIZI)V"), - NATIVE_METHOD(VMDebug, startMethodTracingFd, "(Ljava/lang/String;Ljava/io/FileDescriptor;IIZI)V"), + NATIVE_METHOD(VMDebug, startMethodTracingFd, "(Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V"), NATIVE_METHOD(VMDebug, startMethodTracingFilename, "(Ljava/lang/String;IIZI)V"), NATIVE_METHOD(VMDebug, stopAllocCounting, "()V"), NATIVE_METHOD(VMDebug, stopEmulatorTracing, "()V"), |