| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 const MemoryAllocatorDumpGuid& guid); | 111 const MemoryAllocatorDumpGuid& guid); |
| 112 | 112 |
| 113 // Looks up a shared MemoryAllocatorDump given its guid. | 113 // Looks up a shared MemoryAllocatorDump given its guid. |
| 114 MemoryAllocatorDump* GetSharedGlobalAllocatorDump( | 114 MemoryAllocatorDump* GetSharedGlobalAllocatorDump( |
| 115 const MemoryAllocatorDumpGuid& guid) const; | 115 const MemoryAllocatorDumpGuid& guid) const; |
| 116 | 116 |
| 117 // Returns the map of the MemoryAllocatorDumps added to this dump. | 117 // Returns the map of the MemoryAllocatorDumps added to this dump. |
| 118 const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } | 118 const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } |
| 119 | 119 |
| 120 // Dumps heap usage with |allocator_name|. | 120 // Dumps heap usage with |allocator_name|. |
| 121 void DumpHeapUsage(const base::hash_map<base::trace_event::AllocationContext, | 121 void DumpHeapUsage( |
| 122 base::trace_event::AllocationMetrics>& | 122 const std::unordered_map<base::trace_event::AllocationContext, |
| 123 metrics_by_context, | 123 base::trace_event::AllocationMetrics>& |
| 124 base::trace_event::TraceEventMemoryOverhead& overhead, | 124 metrics_by_context, |
| 125 const char* allocator_name); | 125 base::trace_event::TraceEventMemoryOverhead& overhead, |
| 126 const char* allocator_name); |
| 126 | 127 |
| 127 // Adds an ownership relationship between two MemoryAllocatorDump(s) with the | 128 // Adds an ownership relationship between two MemoryAllocatorDump(s) with the |
| 128 // semantics: |source| owns |target|, and has the effect of attributing | 129 // semantics: |source| owns |target|, and has the effect of attributing |
| 129 // the memory usage of |target| to |source|. |importance| is optional and | 130 // the memory usage of |target| to |source|. |importance| is optional and |
| 130 // relevant only for the cases of co-ownership, where it acts as a z-index: | 131 // relevant only for the cases of co-ownership, where it acts as a z-index: |
| 131 // the owner with the highest importance will be attributed |target|'s memory. | 132 // the owner with the highest importance will be attributed |target|'s memory. |
| 132 void AddOwnershipEdge(const MemoryAllocatorDumpGuid& source, | 133 void AddOwnershipEdge(const MemoryAllocatorDumpGuid& source, |
| 133 const MemoryAllocatorDumpGuid& target, | 134 const MemoryAllocatorDumpGuid& target, |
| 134 int importance); | 135 int importance); |
| 135 void AddOwnershipEdge(const MemoryAllocatorDumpGuid& source, | 136 void AddOwnershipEdge(const MemoryAllocatorDumpGuid& source, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // background mode are disabled for testing. | 215 // background mode are disabled for testing. |
| 215 static bool is_black_hole_non_fatal_for_testing_; | 216 static bool is_black_hole_non_fatal_for_testing_; |
| 216 | 217 |
| 217 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 218 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
| 218 }; | 219 }; |
| 219 | 220 |
| 220 } // namespace trace_event | 221 } // namespace trace_event |
| 221 } // namespace base | 222 } // namespace base |
| 222 | 223 |
| 223 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 224 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
| OLD | NEW |