OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "platform/heap/ThreadState.h" | 32 #include "platform/heap/ThreadState.h" |
33 | 33 |
| 34 #include "base/trace_event/memory_allocator_dump.h" |
| 35 #include "base/trace_event/process_memory_dump.h" |
34 #include "platform/ScriptForbiddenScope.h" | 36 #include "platform/ScriptForbiddenScope.h" |
35 #include "platform/TraceEvent.h" | 37 #include "platform/TraceEvent.h" |
36 #include "platform/heap/BlinkGCMemoryDumpProvider.h" | 38 #include "platform/heap/BlinkGCMemoryDumpProvider.h" |
37 #include "platform/heap/CallbackStack.h" | 39 #include "platform/heap/CallbackStack.h" |
38 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
39 #include "platform/heap/Heap.h" | 41 #include "platform/heap/Heap.h" |
40 #include "platform/heap/MarkingVisitor.h" | 42 #include "platform/heap/MarkingVisitor.h" |
41 #include "platform/heap/SafePoint.h" | 43 #include "platform/heap/SafePoint.h" |
42 #include "public/platform/Platform.h" | 44 #include "public/platform/Platform.h" |
43 #include "public/platform/WebMemoryAllocatorDump.h" | |
44 #include "public/platform/WebProcessMemoryDump.h" | |
45 #include "public/platform/WebScheduler.h" | 45 #include "public/platform/WebScheduler.h" |
46 #include "public/platform/WebThread.h" | 46 #include "public/platform/WebThread.h" |
47 #include "public/platform/WebTraceLocation.h" | 47 #include "public/platform/WebTraceLocation.h" |
48 #include "wtf/DataLog.h" | 48 #include "wtf/DataLog.h" |
49 #include "wtf/Partitions.h" | 49 #include "wtf/Partitions.h" |
50 #include "wtf/ThreadingPrimitives.h" | 50 #include "wtf/ThreadingPrimitives.h" |
51 #if ENABLE(GC_PROFILING) | 51 #if ENABLE(GC_PROFILING) |
52 #include "platform/TracedValue.h" | 52 #include "platform/TracedValue.h" |
53 #include "wtf/text/StringHash.h" | 53 #include "wtf/text/StringHash.h" |
54 #endif | 54 #endif |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1541 | 1541 |
1542 size_t totalLiveCount = 0; | 1542 size_t totalLiveCount = 0; |
1543 size_t totalDeadCount = 0; | 1543 size_t totalDeadCount = 0; |
1544 size_t totalLiveSize = 0; | 1544 size_t totalLiveSize = 0; |
1545 size_t totalDeadSize = 0; | 1545 size_t totalDeadSize = 0; |
1546 for (size_t gcInfoIndex = 1; gcInfoIndex <= GCInfoTable::gcInfoIndex(); ++gc
InfoIndex) { | 1546 for (size_t gcInfoIndex = 1; gcInfoIndex <= GCInfoTable::gcInfoIndex(); ++gc
InfoIndex) { |
1547 String dumpName = classesDumpName + String::format("/%lu_", static_cast<
unsigned long>(gcInfoIndex)); | 1547 String dumpName = classesDumpName + String::format("/%lu_", static_cast<
unsigned long>(gcInfoIndex)); |
1548 #if ENABLE(DETAILED_MEMORY_INFRA) | 1548 #if ENABLE(DETAILED_MEMORY_INFRA) |
1549 dumpName.append(Heap::gcInfo(gcInfoIndex)->className()); | 1549 dumpName.append(Heap::gcInfo(gcInfoIndex)->className()); |
1550 #endif | 1550 #endif |
1551 WebMemoryAllocatorDump* classDump = BlinkGCMemoryDumpProvider::instance(
)->createMemoryAllocatorDumpForCurrentGC(dumpName); | 1551 base::trace_event::MemoryAllocatorDump* classDump = BlinkGCMemoryDumpPro
vider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName); |
1552 classDump->AddScalar("live_count", "objects", info.liveCount[gcInfoIndex
]); | 1552 classDump->AddScalar("live_count", "objects", info.liveCount[gcInfoIndex
]); |
1553 classDump->AddScalar("dead_count", "objects", info.deadCount[gcInfoIndex
]); | 1553 classDump->AddScalar("dead_count", "objects", info.deadCount[gcInfoIndex
]); |
1554 classDump->AddScalar("live_size", "bytes", info.liveSize[gcInfoIndex]); | 1554 classDump->AddScalar("live_size", "bytes", info.liveSize[gcInfoIndex]); |
1555 classDump->AddScalar("dead_size", "bytes", info.deadSize[gcInfoIndex]); | 1555 classDump->AddScalar("dead_size", "bytes", info.deadSize[gcInfoIndex]); |
1556 | 1556 |
1557 totalLiveCount += info.liveCount[gcInfoIndex]; | 1557 totalLiveCount += info.liveCount[gcInfoIndex]; |
1558 totalDeadCount += info.deadCount[gcInfoIndex]; | 1558 totalDeadCount += info.deadCount[gcInfoIndex]; |
1559 totalLiveSize += info.liveSize[gcInfoIndex]; | 1559 totalLiveSize += info.liveSize[gcInfoIndex]; |
1560 totalDeadSize += info.deadSize[gcInfoIndex]; | 1560 totalDeadSize += info.deadSize[gcInfoIndex]; |
1561 } | 1561 } |
1562 | 1562 |
1563 WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()->
createMemoryAllocatorDumpForCurrentGC(threadDumpName); | 1563 base::trace_event::MemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvid
er::instance()->createMemoryAllocatorDumpForCurrentGC(threadDumpName); |
1564 threadDump->AddScalar("live_count", "objects", totalLiveCount); | 1564 threadDump->AddScalar("live_count", "objects", totalLiveCount); |
1565 threadDump->AddScalar("dead_count", "objects", totalDeadCount); | 1565 threadDump->AddScalar("dead_count", "objects", totalDeadCount); |
1566 threadDump->AddScalar("live_size", "bytes", totalLiveSize); | 1566 threadDump->AddScalar("live_size", "bytes", totalLiveSize); |
1567 threadDump->AddScalar("dead_size", "bytes", totalDeadSize); | 1567 threadDump->AddScalar("dead_size", "bytes", totalDeadSize); |
1568 | 1568 |
1569 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1569 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide
r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
1570 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1570 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi
der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
1571 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1571 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
1572 } | 1572 } |
1573 | 1573 |
1574 #if ENABLE(GC_PROFILING) | 1574 #if ENABLE(GC_PROFILING) |
1575 const GCInfo* ThreadState::findGCInfoFromAllThreads(Address address) | 1575 const GCInfo* ThreadState::findGCInfoFromAllThreads(Address address) |
1576 { | 1576 { |
1577 bool needLockForIteration = !ThreadState::current()->isInGC(); | 1577 bool needLockForIteration = !ThreadState::current()->isInGC(); |
1578 if (needLockForIteration) | 1578 if (needLockForIteration) |
1579 threadAttachMutex().lock(); | 1579 threadAttachMutex().lock(); |
1580 | 1580 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 json->beginArray(it->key.ascii().data()); | 1661 json->beginArray(it->key.ascii().data()); |
1662 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1662 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
1663 json->pushInteger(it->value.ages[age]); | 1663 json->pushInteger(it->value.ages[age]); |
1664 json->endArray(); | 1664 json->endArray(); |
1665 } | 1665 } |
1666 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); | 1666 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); |
1667 } | 1667 } |
1668 #endif | 1668 #endif |
1669 | 1669 |
1670 } // namespace blink | 1670 } // namespace blink |
OLD | NEW |