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

Unified Diff: content/common/discardable_shared_memory_heap.cc

Issue 1308213005: Fix the size dumped by child discardable manager for tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@discardable
Patch Set: Change to block size. Created 5 years, 4 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
Index: content/common/discardable_shared_memory_heap.cc
diff --git a/content/common/discardable_shared_memory_heap.cc b/content/common/discardable_shared_memory_heap.cc
index 8996979a730afc1e252de45557bf3acf0574e038..3da78092afa4058b0b484d86ca3f2b7f2ee582ad 100644
--- a/content/common/discardable_shared_memory_heap.cc
+++ b/content/common/discardable_shared_memory_heap.cc
@@ -68,16 +68,18 @@ bool DiscardableSharedMemoryHeap::ScopedMemorySegment::ContainsSpan(
base::trace_event::MemoryAllocatorDump*
DiscardableSharedMemoryHeap::ScopedMemorySegment::CreateMemoryAllocatorDump(
Span* span,
+ size_t block_size,
const char* name,
base::trace_event::ProcessMemoryDump* pmd) const {
DCHECK_EQ(shared_memory_, span->shared_memory());
base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(name);
dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
- static_cast<uint64_t>(span->length()));
+ static_cast<uint64_t>(span->length() * block_size));
- pmd->AddSuballocation(dump->guid(),
- base::StringPrintf("discardable/segment_%d", id_));
+ pmd->AddSuballocation(
+ dump->guid(),
+ base::StringPrintf("discardable/segment_%d/allocated_objects", id_));
reveman 2015/08/26 16:02:09 why are you adding /allocated_objects here?
ssid 2015/08/26 16:05:57 The sub-allocations are usually added under "alloc
reveman 2015/08/26 16:21:04 Ack.
return dump;
}
@@ -438,7 +440,7 @@ DiscardableSharedMemoryHeap::CreateMemoryAllocatorDump(
return segment->ContainsSpan(span);
});
DCHECK(it != memory_segments_.end());
- return (*it)->CreateMemoryAllocatorDump(span, name, pmd);
+ return (*it)->CreateMemoryAllocatorDump(span, block_size_, name, pmd);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698