summaryrefslogtreecommitdiffstats
path: root/vm/Debugger.c
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2010-01-22 16:36:30 -0800
committerAndy McFadden <fadden@android.com>2010-01-27 14:59:20 -0800
commit0171812e59e2520a4345b9bbadd4f7afa0a1de16 (patch)
tree8eb7ba7df9131b218631775caa2d8eb081bb925f /vm/Debugger.c
parentbdca5d668ebf34b769b9764a75d5bc12219579a5 (diff)
downloadandroid_dalvik-0171812e59e2520a4345b9bbadd4f7afa0a1de16.tar.gz
android_dalvik-0171812e59e2520a4345b9bbadd4f7afa0a1de16.tar.bz2
android_dalvik-0171812e59e2520a4345b9bbadd4f7afa0a1de16.zip
Add streaming method profiling support.
The goal is to allow DDMS to start/stop method profiling in apps that don't have permission to write to /sdcard. Instead of writing the profiling data to disk and then pulling it off, we just blast the whole thing straight from memory. This includes: - New method tracing start call (startMethodTracingDdms). - Rearrangement of existing VMDebug method tracing calls for sanity. - Addition of "vector" chunk send function, with corresponding update to the JDWP transport function. - Reshuffled the method trace start interlock, which seemed racy. - Post new method-trace-profiling-streaming feature to DDMS. Also: - Added an internal exception-throw function that allows a printf format string, so we can put useful detail into exception messages. For bug 2160407.
Diffstat (limited to 'vm/Debugger.c')
-rw-r--r--vm/Debugger.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/vm/Debugger.c b/vm/Debugger.c
index 67a83a343..be6fa6621 100644
--- a/vm/Debugger.c
+++ b/vm/Debugger.c
@@ -3024,7 +3024,18 @@ void dvmDbgDdmDisconnected(void)
/*
* Send up a JDWP event packet with a DDM chunk in it.
*/
-void dvmDbgDdmSendChunk(int type, int len, const u1* buf)
+void dvmDbgDdmSendChunk(int type, size_t len, const u1* buf)
+{
+ assert(buf != NULL);
+ struct iovec vec[1] = { {(void*)buf, len} };
+ dvmDbgDdmSendChunkV(type, vec, 1);
+}
+
+/*
+ * Send up a JDWP event packet with a DDM chunk in it. The chunk is
+ * concatenated from multiple source buffers.
+ */
+void dvmDbgDdmSendChunkV(int type, const struct iovec* iov, int iovcnt)
{
if (gDvm.jdwpState == NULL) {
LOGV("Debugger thread not active, ignoring DDM send (t=0x%08x l=%d)\n",
@@ -3032,6 +3043,6 @@ void dvmDbgDdmSendChunk(int type, int len, const u1* buf)
return;
}
- dvmJdwpDdmSendChunk(gDvm.jdwpState, type, len, buf);
+ dvmJdwpDdmSendChunkV(gDvm.jdwpState, type, iov, iovcnt);
}