Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1530)

Unified Diff: Source/platform/heap/ThreadState.cpp

Issue 1149673002: Adding blink gc memory dump infrastructure for thread specific dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing nits. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index c47c92bac6ba45ffcd42d4f139cde1877a0bc354..f30fd88f91cc75c1be655b1004fc71d7291afc63 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -38,6 +38,8 @@
#include "platform/heap/Heap.h"
#include "platform/heap/SafePoint.h"
#include "public/platform/Platform.h"
+#include "public/platform/WebMemoryAllocatorDump.h"
+#include "public/platform/WebProcessMemoryDump.h"
#include "public/platform/WebScheduler.h"
#include "public/platform/WebThread.h"
#include "public/platform/WebTraceLocation.h"
@@ -379,6 +381,36 @@ void ThreadState::visitPersistents(Visitor* visitor)
}
}
+void ThreadState::dumpMemory()
+{
Primiano Tucci (use gerrit) 2015/05/22 15:50:21 Should we have an ASSERT(isInGC()) here, WDYT?
ssid 2015/05/22 16:05:16 The method which calls this (Heap::postGC()) alrea
+#define SNAPSHOT_HEAP(HeapType) \
+ { \
+ String allocatorBaseName; \
+ if (isMainThread()) { \
Primiano Tucci (use gerrit) 2015/05/22 15:50:21 nit: the \ on line 389 is misaligned :)
ssid 2015/05/22 17:17:10 Done.
+ allocatorBaseName = String("blink_gc/thread_main/heaps/" #HeapType); \
+ } \
+ else { \
+ allocatorBaseName = String::format("blink_gc/thread_%ld/heaps/" #HeapType, m_thread); \
+ } \
+ m_heaps[HeapType##HeapIndex]->dumpMemory(allocatorBaseName); \
+ }
+
+ SNAPSHOT_HEAP(NormalPage1);
+ SNAPSHOT_HEAP(NormalPage2);
+ SNAPSHOT_HEAP(NormalPage3);
+ SNAPSHOT_HEAP(NormalPage4);
+ SNAPSHOT_HEAP(Vector1);
+ SNAPSHOT_HEAP(Vector2);
+ SNAPSHOT_HEAP(Vector3);
+ SNAPSHOT_HEAP(Vector4);
+ SNAPSHOT_HEAP(InlineVector);
+ SNAPSHOT_HEAP(HashTable);
+ SNAPSHOT_HEAP(LargeObject);
+ FOR_EACH_TYPED_HEAP(SNAPSHOT_HEAP);
+
+#undef SNAPSHOT_HEAP
+}
+
#if ENABLE(GC_PROFILING)
const GCInfo* ThreadState::findGCInfo(Address address)
{
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698