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 <vector> | 10 #include <vector> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 MemoryAllocatorDump* GetOrCreateAllocatorDump( | 91 MemoryAllocatorDump* GetOrCreateAllocatorDump( |
92 const std::string& absolute_name); | 92 const std::string& absolute_name); |
93 | 93 |
94 // Creates a shared MemoryAllocatorDump, to express cross-process sharing. | 94 // Creates a shared MemoryAllocatorDump, to express cross-process sharing. |
95 // Shared allocator dumps are allowed to have duplicate guids within the | 95 // Shared allocator dumps are allowed to have duplicate guids within the |
96 // global scope, in order to reference the same dump from multiple processes. | 96 // global scope, in order to reference the same dump from multiple processes. |
97 // See the design doc goo.gl/keU6Bf for reference usage patterns. | 97 // See the design doc goo.gl/keU6Bf for reference usage patterns. |
98 MemoryAllocatorDump* CreateSharedGlobalAllocatorDump( | 98 MemoryAllocatorDump* CreateSharedGlobalAllocatorDump( |
99 const MemoryAllocatorDumpGuid& guid); | 99 const MemoryAllocatorDumpGuid& guid); |
100 | 100 |
| 101 // Creates a shared MemoryAllocatorDump as CreateSharedGlobalAllocatorDump, |
| 102 // but with a WEAK flag. A weak dump will be discarded unless a non-weak dump |
| 103 // is created using CreateSharedGlobalAllocatorDump by at least one process. |
| 104 // The WEAK flag does not apply if a non-weak dump with the same GUID already |
| 105 // exists or is created later. All owners and children of the discarded dump |
| 106 // will also be discarded transitively. |
| 107 MemoryAllocatorDump* CreateWeakSharedGlobalAllocatorDump( |
| 108 const MemoryAllocatorDumpGuid& guid); |
| 109 |
101 // Looks up a shared MemoryAllocatorDump given its guid. | 110 // Looks up a shared MemoryAllocatorDump given its guid. |
102 MemoryAllocatorDump* GetSharedGlobalAllocatorDump( | 111 MemoryAllocatorDump* GetSharedGlobalAllocatorDump( |
103 const MemoryAllocatorDumpGuid& guid) const; | 112 const MemoryAllocatorDumpGuid& guid) const; |
104 | 113 |
105 // Returns the map of the MemoryAllocatorDumps added to this dump. | 114 // Returns the map of the MemoryAllocatorDumps added to this dump. |
106 const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } | 115 const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } |
107 | 116 |
108 // Adds a heap dump for the allocator with |absolute_name|. The |TracedValue| | 117 // Adds a heap dump for the allocator with |absolute_name|. The |TracedValue| |
109 // must have the correct format. |trace_event::HeapDumper| will generate such | 118 // must have the correct format. |trace_event::HeapDumper| will generate such |
110 // a value from a |trace_event::AllocationRegister|. | 119 // a value from a |trace_event::AllocationRegister|. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Keeps track of relationships between MemoryAllocatorDump(s). | 191 // Keeps track of relationships between MemoryAllocatorDump(s). |
183 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; | 192 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; |
184 | 193 |
185 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 194 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
186 }; | 195 }; |
187 | 196 |
188 } // namespace trace_event | 197 } // namespace trace_event |
189 } // namespace base | 198 } // namespace base |
190 | 199 |
191 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 200 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
OLD | NEW |