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

Side by Side Diff: third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp

Issue 2013643005: [tracing] Fix V8 and PartitionAlloc dump provider for background mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@whitelist_mdp
Patch Set: fix comment. Created 4 years, 6 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
« no previous file with comments | « gin/v8_isolate_memory_dump_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/PartitionAllocMemoryDumpProvider.h" 5 #include "platform/PartitionAllocMemoryDumpProvider.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/trace_event/heap_profiler_allocation_context.h" 8 #include "base/trace_event/heap_profiler_allocation_context.h"
9 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" 9 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
10 #include "base/trace_event/heap_profiler_allocation_register.h" 10 #include "base/trace_event/heap_profiler_allocation_register.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 memoryDump->DumpHeapUsage(metricsByContext, overhead, "partition_alloc") ; 130 memoryDump->DumpHeapUsage(metricsByContext, overhead, "partition_alloc") ;
131 } 131 }
132 132
133 PartitionStatsDumperImpl partitionStatsDumper(memoryDump, levelOfDetail); 133 PartitionStatsDumperImpl partitionStatsDumper(memoryDump, levelOfDetail);
134 134
135 base::trace_event::MemoryAllocatorDump* partitionsDump = memoryDump->CreateA llocatorDump( 135 base::trace_event::MemoryAllocatorDump* partitionsDump = memoryDump->CreateA llocatorDump(
136 base::StringPrintf("%s/%s", kPartitionAllocDumpName, kPartitionsDumpName )); 136 base::StringPrintf("%s/%s", kPartitionAllocDumpName, kPartitionsDumpName ));
137 137
138 // This method calls memoryStats.partitionsDumpBucketStats with memory stati stics. 138 // This method calls memoryStats.partitionsDumpBucketStats with memory stati stics.
139 WTF::Partitions::dumpMemoryStats(levelOfDetail == MemoryDumpLevelOfDetail::L IGHT, &partitionStatsDumper); 139 WTF::Partitions::dumpMemoryStats(levelOfDetail != MemoryDumpLevelOfDetail::D ETAILED, &partitionStatsDumper);
140 140
141 base::trace_event::MemoryAllocatorDump* allocatedObjectsDump = memoryDump->C reateAllocatorDump(Partitions::kAllocatedObjectPoolName); 141 base::trace_event::MemoryAllocatorDump* allocatedObjectsDump = memoryDump->C reateAllocatorDump(Partitions::kAllocatedObjectPoolName);
142 allocatedObjectsDump->AddScalar("size", "bytes", partitionStatsDumper.totalA ctiveBytes()); 142 allocatedObjectsDump->AddScalar("size", "bytes", partitionStatsDumper.totalA ctiveBytes());
143 memoryDump->AddOwnershipEdge(allocatedObjectsDump->guid(), partitionsDump->g uid()); 143 memoryDump->AddOwnershipEdge(allocatedObjectsDump->guid(), partitionsDump->g uid());
144 144
145 return true; 145 return true;
146 } 146 }
147 147
148 // |m_allocationRegister| should be initialized only when necessary to avoid was te of memory. 148 // |m_allocationRegister| should be initialized only when necessary to avoid was te of memory.
149 PartitionAllocMemoryDumpProvider::PartitionAllocMemoryDumpProvider() 149 PartitionAllocMemoryDumpProvider::PartitionAllocMemoryDumpProvider()
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 void PartitionAllocMemoryDumpProvider::remove(void* address) 185 void PartitionAllocMemoryDumpProvider::remove(void* address)
186 { 186 {
187 MutexLocker locker(m_allocationRegisterMutex); 187 MutexLocker locker(m_allocationRegisterMutex);
188 if (m_allocationRegister) 188 if (m_allocationRegister)
189 m_allocationRegister->Remove(address); 189 m_allocationRegister->Remove(address);
190 } 190 }
191 191
192 } // namespace blink 192 } // namespace blink
OLDNEW
« no previous file with comments | « gin/v8_isolate_memory_dump_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698