Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
| 6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 // Looks up a shared MemoryAllocatorDump given its guid. | 112 // Looks up a shared MemoryAllocatorDump given its guid. |
| 113 MemoryAllocatorDump* GetSharedGlobalAllocatorDump( | 113 MemoryAllocatorDump* GetSharedGlobalAllocatorDump( |
| 114 const MemoryAllocatorDumpGuid& guid) const; | 114 const MemoryAllocatorDumpGuid& guid) const; |
| 115 | 115 |
| 116 // Returns the map of the MemoryAllocatorDumps added to this dump. | 116 // Returns the map of the MemoryAllocatorDumps added to this dump. |
| 117 const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } | 117 const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } |
| 118 | 118 |
| 119 // Adds a heap dump for the allocator with |absolute_name|. The |TracedValue| | 119 // Adds a heap dump for the allocator with |absolute_name|. The |TracedValue| |
| 120 // must have the correct format. |trace_event::HeapDumper| will generate such | 120 // must have the correct format. |trace_event::HeapDumper| will generate such |
| 121 // a value from a |trace_event::AllocationRegister|. | 121 // a value from a |trace_event::AllocationRegister|. |
| 122 void AddHeapDump(const std::string& absolute_name, | 122 void AddHeapDump(const std::string& absolute_name, |
|
Primiano Tucci (use gerrit)
2016/04/22 13:05:57
at this point we can remove this, right?
bashi
2016/04/24 23:33:12
BlinkGCMemoryDumpProvider uses it indirectly. Adde
| |
| 123 std::unique_ptr<TracedValue> heap_dump); | 123 std::unique_ptr<TracedValue> heap_dump); |
| 124 | 124 |
| 125 // Dumps heap usage. | |
| 126 void DumpHeapUsage(const base::hash_map<base::trace_event::AllocationContext, | |
| 127 base::trace_event::AllocationMetrics>& | |
| 128 metrics_by_context, | |
| 129 base::trace_event::TraceEventMemoryOverhead& overhead, | |
| 130 const char* allocator_name); | |
| 131 | |
| 125 // Adds an ownership relationship between two MemoryAllocatorDump(s) with the | 132 // Adds an ownership relationship between two MemoryAllocatorDump(s) with the |
| 126 // semantics: |source| owns |target|, and has the effect of attributing | 133 // semantics: |source| owns |target|, and has the effect of attributing |
| 127 // the memory usage of |target| to |source|. |importance| is optional and | 134 // the memory usage of |target| to |source|. |importance| is optional and |
| 128 // relevant only for the cases of co-ownership, where it acts as a z-index: | 135 // relevant only for the cases of co-ownership, where it acts as a z-index: |
| 129 // the owner with the highest importance will be attributed |target|'s memory. | 136 // the owner with the highest importance will be attributed |target|'s memory. |
| 130 void AddOwnershipEdge(const MemoryAllocatorDumpGuid& source, | 137 void AddOwnershipEdge(const MemoryAllocatorDumpGuid& source, |
| 131 const MemoryAllocatorDumpGuid& target, | 138 const MemoryAllocatorDumpGuid& target, |
| 132 int importance); | 139 int importance); |
| 133 void AddOwnershipEdge(const MemoryAllocatorDumpGuid& source, | 140 void AddOwnershipEdge(const MemoryAllocatorDumpGuid& source, |
| 134 const MemoryAllocatorDumpGuid& target); | 141 const MemoryAllocatorDumpGuid& target); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 // Keeps track of relationships between MemoryAllocatorDump(s). | 200 // Keeps track of relationships between MemoryAllocatorDump(s). |
| 194 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; | 201 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; |
| 195 | 202 |
| 196 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 203 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
| 197 }; | 204 }; |
| 198 | 205 |
| 199 } // namespace trace_event | 206 } // namespace trace_event |
| 200 } // namespace base | 207 } // namespace base |
| 201 | 208 |
| 202 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 209 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
| OLD | NEW |