| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 int importance; | 41 int importance; |
| 42 const char* type; | 42 const char* type; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // Maps allocator dumps absolute names (allocator_name/heap/subheap) to | 45 // Maps allocator dumps absolute names (allocator_name/heap/subheap) to |
| 46 // MemoryAllocatorDump instances. | 46 // MemoryAllocatorDump instances. |
| 47 using AllocatorDumpsMap = | 47 using AllocatorDumpsMap = |
| 48 SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; | 48 SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; |
| 49 | 49 |
| 50 #if defined(COUNT_RESIDENT_BYTES_SUPPORTED) | 50 #if defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
| 51 // Returns the total bytes resident for a virtual address range, with given | 51 // Counts the total bytes resident for a virtual address range, with given |
| 52 // |start_address| and |mapped_size|. |mapped_size| is specified in bytes. The | 52 // |start_address| and |mapped_size| and sets |resident_size|. |mapped_size| |
| 53 // value returned is valid only if the given range is currently mmapped by the | 53 // is specified in bytes. The value returned is valid only if the given range |
| 54 // process. The |start_address| must be page-aligned. | 54 // is currently mmapped by the process. The |start_address| must be |
| 55 static size_t CountResidentBytes(void* start_address, size_t mapped_size); | 55 // page-aligned. |
| 56 // Returns true on success. |
| 57 static bool CountResidentBytes(void* start_address, |
| 58 size_t mapped_size, |
| 59 size_t* resident_size); |
| 56 #endif | 60 #endif |
| 57 | 61 |
| 58 ProcessMemoryDump(const scoped_refptr<MemoryDumpSessionState>& session_state); | 62 ProcessMemoryDump(const scoped_refptr<MemoryDumpSessionState>& session_state); |
| 59 ~ProcessMemoryDump(); | 63 ~ProcessMemoryDump(); |
| 60 | 64 |
| 61 // Creates a new MemoryAllocatorDump with the given name and returns the | 65 // Creates a new MemoryAllocatorDump with the given name and returns the |
| 62 // empty object back to the caller. | 66 // empty object back to the caller. |
| 63 // Arguments: | 67 // Arguments: |
| 64 // absolute_name: a name that uniquely identifies allocator dumps produced | 68 // absolute_name: a name that uniquely identifies allocator dumps produced |
| 65 // by this provider. It is possible to specify nesting by using a | 69 // by this provider. It is possible to specify nesting by using a |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // Keeps track of relationships between MemoryAllocatorDump(s). | 169 // Keeps track of relationships between MemoryAllocatorDump(s). |
| 166 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; | 170 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; |
| 167 | 171 |
| 168 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 172 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
| 169 }; | 173 }; |
| 170 | 174 |
| 171 } // namespace trace_event | 175 } // namespace trace_event |
| 172 } // namespace base | 176 } // namespace base |
| 173 | 177 |
| 174 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 178 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
| OLD | NEW |