OSDN Git Service

hprof generation, not writing the first record
authorJohan Erlandsson <johan.erlandsson@sonyericsson.com>
Mon, 11 Jun 2012 16:18:59 +0000 (18:18 +0200)
committerJohan Redestig <johan.redestig@sonymobile.com>
Mon, 2 Jul 2012 14:00:12 +0000 (16:00 +0200)
We miss some roots since the first record isn't initialized.

Change-Id: I50c80a701a4ee142c52602b9015f6e93be54da9f

vm/hprof/Hprof.cpp

index 4a6b1a6..09890f9 100644 (file)
@@ -246,6 +246,8 @@ int hprofDumpHeap(const char* fileName, int fd, bool directToDdms)
     if (ctx == NULL) {
         return -1;
     }
+    // first record
+    hprofStartNewRecord(ctx, HPROF_TAG_HEAP_DUMP_SEGMENT, HPROF_TIME);
     dvmVisitRoots(hprofRootVisitor, ctx);
     dvmHeapBitmapWalk(dvmHeapSourceGetLiveBits(), hprofBitmapCallback, ctx);
     hprofFinishHeapDump(ctx);