Chromium Code Reviews| 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 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1471 | 1471 |
| 1472 #undef SNAPSHOT_HEAP | 1472 #undef SNAPSHOT_HEAP |
| 1473 | 1473 |
| 1474 if (type == SnapshotType::FreelistSnapshot) | 1474 if (type == SnapshotType::FreelistSnapshot) |
| 1475 return; | 1475 return; |
| 1476 | 1476 |
| 1477 size_t totalLiveCount = 0; | 1477 size_t totalLiveCount = 0; |
| 1478 size_t totalDeadCount = 0; | 1478 size_t totalDeadCount = 0; |
| 1479 size_t totalLiveSize = 0; | 1479 size_t totalLiveSize = 0; |
| 1480 size_t totalDeadSize = 0; | 1480 size_t totalDeadSize = 0; |
| 1481 for (size_t gcInfoIndex = 1; gcInfoIndex <= GCInfoTable::gcInfoIndex(); ++gc InfoIndex) { | 1481 for (size_t gcInfoIndex = 1; gcInfoIndex <= GCInfoTable::gcInfoIndex(); ++gc InfoIndex) { |
|
Primiano Tucci (use gerrit)
2016/02/19 10:04:51
I wonder (for a next followup cl, not this one): i
hajimehoshi
2016/02/19 10:32:03
Hmm, this CL doesn't affect if the output is spamm
Primiano Tucci (use gerrit)
2016/02/19 11:11:52
Right. I am just saying that now that we have the
| |
| 1482 String dumpName = classesDumpName + String::format("/%lu_", static_cast< unsigned long>(gcInfoIndex)); | 1482 const char* className = Heap::gcInfo(gcInfoIndex)->className(); |
| 1483 #if ENABLE(DETAILED_MEMORY_INFRA) | 1483 String dumpName = classesDumpName + String::format("/%lu_%s", static_cas t<unsigned long>(gcInfoIndex), className ? className : ""); |
| 1484 dumpName.append(Heap::gcInfo(gcInfoIndex)->className()); | |
| 1485 #endif | |
| 1486 WebMemoryAllocatorDump* classDump = BlinkGCMemoryDumpProvider::instance( )->createMemoryAllocatorDumpForCurrentGC(dumpName); | 1484 WebMemoryAllocatorDump* classDump = BlinkGCMemoryDumpProvider::instance( )->createMemoryAllocatorDumpForCurrentGC(dumpName); |
| 1487 classDump->addScalar("live_count", "objects", info.liveCount[gcInfoIndex ]); | 1485 classDump->addScalar("live_count", "objects", info.liveCount[gcInfoIndex ]); |
| 1488 classDump->addScalar("dead_count", "objects", info.deadCount[gcInfoIndex ]); | 1486 classDump->addScalar("dead_count", "objects", info.deadCount[gcInfoIndex ]); |
| 1489 classDump->addScalar("live_size", "bytes", info.liveSize[gcInfoIndex]); | 1487 classDump->addScalar("live_size", "bytes", info.liveSize[gcInfoIndex]); |
| 1490 classDump->addScalar("dead_size", "bytes", info.deadSize[gcInfoIndex]); | 1488 classDump->addScalar("dead_size", "bytes", info.deadSize[gcInfoIndex]); |
| 1491 | 1489 |
| 1492 totalLiveCount += info.liveCount[gcInfoIndex]; | 1490 totalLiveCount += info.liveCount[gcInfoIndex]; |
| 1493 totalDeadCount += info.deadCount[gcInfoIndex]; | 1491 totalDeadCount += info.deadCount[gcInfoIndex]; |
| 1494 totalLiveSize += info.liveSize[gcInfoIndex]; | 1492 totalLiveSize += info.liveSize[gcInfoIndex]; |
| 1495 totalDeadSize += info.deadSize[gcInfoIndex]; | 1493 totalDeadSize += info.deadSize[gcInfoIndex]; |
| 1496 } | 1494 } |
| 1497 | 1495 |
| 1498 WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()-> createMemoryAllocatorDumpForCurrentGC(threadDumpName); | 1496 WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()-> createMemoryAllocatorDumpForCurrentGC(threadDumpName); |
| 1499 threadDump->addScalar("live_count", "objects", totalLiveCount); | 1497 threadDump->addScalar("live_count", "objects", totalLiveCount); |
| 1500 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1498 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1501 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1499 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1502 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1500 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1503 | 1501 |
| 1504 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1502 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1505 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1503 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1506 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); | 1504 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1507 } | 1505 } |
| 1508 | 1506 |
| 1509 } // namespace blink | 1507 } // namespace blink |
| OLD | NEW |