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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 #include "platform/heap/ThreadState.h" 32 #include "platform/heap/ThreadState.h"
33 33
34 #include "platform/ScriptForbiddenScope.h" 34 #include "platform/ScriptForbiddenScope.h"
35 #include "platform/TraceEvent.h" 35 #include "platform/TraceEvent.h"
36 #include "platform/heap/CallbackStack.h" 36 #include "platform/heap/CallbackStack.h"
37 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
38 #include "platform/heap/Heap.h" 38 #include "platform/heap/Heap.h"
39 #include "platform/heap/SafePoint.h" 39 #include "platform/heap/SafePoint.h"
40 #include "public/platform/Platform.h" 40 #include "public/platform/Platform.h"
41 #include "public/platform/WebMemoryAllocatorDump.h"
42 #include "public/platform/WebProcessMemoryDump.h"
Primiano Tucci (use gerrit) 2015/05/22 19:45:57 I think you don't need this anymore
ssid 2015/05/26 11:08:43 Done.
41 #include "public/platform/WebScheduler.h" 43 #include "public/platform/WebScheduler.h"
42 #include "public/platform/WebThread.h" 44 #include "public/platform/WebThread.h"
43 #include "public/platform/WebTraceLocation.h" 45 #include "public/platform/WebTraceLocation.h"
44 #include "wtf/Partitions.h" 46 #include "wtf/Partitions.h"
45 #include "wtf/ThreadingPrimitives.h" 47 #include "wtf/ThreadingPrimitives.h"
46 #if ENABLE(GC_PROFILING) 48 #if ENABLE(GC_PROFILING)
47 #include "platform/TracedValue.h" 49 #include "platform/TracedValue.h"
48 #include "wtf/text/StringHash.h" 50 #include "wtf/text/StringHash.h"
49 #endif 51 #endif
50 52
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 374
373 void ThreadState::visitPersistents(Visitor* visitor) 375 void ThreadState::visitPersistents(Visitor* visitor)
374 { 376 {
375 m_persistents->trace(visitor); 377 m_persistents->trace(visitor);
376 if (m_traceDOMWrappers) { 378 if (m_traceDOMWrappers) {
377 TRACE_EVENT0("blink_gc", "V8GCController::traceDOMWrappers"); 379 TRACE_EVENT0("blink_gc", "V8GCController::traceDOMWrappers");
378 m_traceDOMWrappers(m_isolate, visitor); 380 m_traceDOMWrappers(m_isolate, visitor);
379 } 381 }
380 } 382 }
381 383
384 void ThreadState::dumpMemory()
385 {
386 #define SNAPSHOT_HEAP(HeapType) \
387 { \
388 String allocatorBaseName; \
389 if (isMainThread()) { \
390 allocatorBaseName = String("blink_gc/thread_main/heaps/" #HeapType); \
391 } \
392 else { \
393 allocatorBaseName = String::format("blink_gc/thread_%ld/heaps/" #Hea pType, m_thread); \
394 } \
395 m_heaps[HeapType##HeapIndex]->dumpMemory(allocatorBaseName); \
396 }
397
398 SNAPSHOT_HEAP(NormalPage1);
399 SNAPSHOT_HEAP(NormalPage2);
400 SNAPSHOT_HEAP(NormalPage3);
401 SNAPSHOT_HEAP(NormalPage4);
402 SNAPSHOT_HEAP(Vector1);
403 SNAPSHOT_HEAP(Vector2);
404 SNAPSHOT_HEAP(Vector3);
405 SNAPSHOT_HEAP(Vector4);
406 SNAPSHOT_HEAP(InlineVector);
407 SNAPSHOT_HEAP(HashTable);
408 SNAPSHOT_HEAP(LargeObject);
409 FOR_EACH_TYPED_HEAP(SNAPSHOT_HEAP);
410
411 #undef SNAPSHOT_HEAP
412 }
413
382 #if ENABLE(GC_PROFILING) 414 #if ENABLE(GC_PROFILING)
383 const GCInfo* ThreadState::findGCInfo(Address address) 415 const GCInfo* ThreadState::findGCInfo(Address address)
384 { 416 {
385 if (BasePage* page = findPageFromAddress(address)) 417 if (BasePage* page = findPageFromAddress(address))
386 return page->findGCInfo(address); 418 return page->findGCInfo(address);
387 return nullptr; 419 return nullptr;
388 } 420 }
389 421
390 size_t ThreadState::SnapshotInfo::getClassTag(const GCInfo* gcInfo) 422 size_t ThreadState::SnapshotInfo::getClassTag(const GCInfo* gcInfo)
391 { 423 {
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 json->beginArray(it->key.ascii().data()); 1361 json->beginArray(it->key.ascii().data());
1330 for (size_t age = 0; age <= maxHeapObjectAge; ++age) 1362 for (size_t age = 0; age <= maxHeapObjectAge; ++age)
1331 json->pushInteger(it->value.ages[age]); 1363 json->pushInteger(it->value.ages[age]);
1332 json->endArray(); 1364 json->endArray();
1333 } 1365 }
1334 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release()); 1366 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release());
1335 } 1367 }
1336 #endif 1368 #endif
1337 1369
1338 } // namespace blink 1370 } // namespace blink
OLDNEW
« 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