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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 MemoryAllocatorDump* CreateWeakSharedGlobalAllocatorDump( | 109 MemoryAllocatorDump* CreateWeakSharedGlobalAllocatorDump( |
110 const MemoryAllocatorDumpGuid& guid); | 110 const MemoryAllocatorDumpGuid& guid); |
111 | 111 |
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| | |
120 // must have the correct format. |trace_event::HeapDumper| will generate such | |
121 // a value from a |trace_event::AllocationRegister|. | |
122 // TODO(bashi): Remove this when WebMemoryDumpProvider is gone. | |
123 // http://crbug.com/605822 | |
124 void AddHeapDump(const std::string& absolute_name, | |
125 std::unique_ptr<TracedValue> heap_dump); | |
126 | |
127 // Dumps heap usage with |allocator_name|. | 119 // Dumps heap usage with |allocator_name|. |
128 void DumpHeapUsage(const base::hash_map<base::trace_event::AllocationContext, | 120 void DumpHeapUsage(const base::hash_map<base::trace_event::AllocationContext, |
129 base::trace_event::AllocationMetrics>& | 121 base::trace_event::AllocationMetrics>& |
130 metrics_by_context, | 122 metrics_by_context, |
131 base::trace_event::TraceEventMemoryOverhead& overhead, | 123 base::trace_event::TraceEventMemoryOverhead& overhead, |
132 const char* allocator_name); | 124 const char* allocator_name); |
133 | 125 |
134 // Adds an ownership relationship between two MemoryAllocatorDump(s) with the | 126 // Adds an ownership relationship between two MemoryAllocatorDump(s) with the |
135 // semantics: |source| owns |target|, and has the effect of attributing | 127 // semantics: |source| owns |target|, and has the effect of attributing |
136 // the memory usage of |target| to |source|. |importance| is optional and | 128 // the memory usage of |target| to |source|. |importance| is optional and |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Keeps track of relationships between MemoryAllocatorDump(s). | 194 // Keeps track of relationships between MemoryAllocatorDump(s). |
203 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; | 195 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; |
204 | 196 |
205 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 197 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
206 }; | 198 }; |
207 | 199 |
208 } // namespace trace_event | 200 } // namespace trace_event |
209 } // namespace base | 201 } // namespace base |
210 | 202 |
211 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 203 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
OLD | NEW |