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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 }; | 46 }; |
47 | 47 |
48 // Maps allocator dumps absolute names (allocator_name/heap/subheap) to | 48 // Maps allocator dumps absolute names (allocator_name/heap/subheap) to |
49 // MemoryAllocatorDump instances. | 49 // MemoryAllocatorDump instances. |
50 using AllocatorDumpsMap = | 50 using AllocatorDumpsMap = |
51 std::unordered_map<std::string, std::unique_ptr<MemoryAllocatorDump>>; | 51 std::unordered_map<std::string, std::unique_ptr<MemoryAllocatorDump>>; |
52 | 52 |
53 using HeapDumpsMap = | 53 using HeapDumpsMap = |
54 std::unordered_map<std::string, std::unique_ptr<TracedValue>>; | 54 std::unordered_map<std::string, std::unique_ptr<TracedValue>>; |
55 | 55 |
| 56 static const int kDefaultImportance = 0; |
| 57 |
56 #if defined(COUNT_RESIDENT_BYTES_SUPPORTED) | 58 #if defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
57 // Returns the number of bytes in a kernel memory page. Some platforms may | 59 // Returns the number of bytes in a kernel memory page. Some platforms may |
58 // have a different value for kernel page sizes from user page sizes. It is | 60 // have a different value for kernel page sizes from user page sizes. It is |
59 // important to use kernel memory page sizes for resident bytes calculation. | 61 // important to use kernel memory page sizes for resident bytes calculation. |
60 // In most cases, the two are the same. | 62 // In most cases, the two are the same. |
61 static size_t GetSystemPageSize(); | 63 static size_t GetSystemPageSize(); |
62 | 64 |
63 // Returns the total bytes resident for a virtual address range, with given | 65 // Returns the total bytes resident for a virtual address range, with given |
64 // |start_address| and |mapped_size|. |mapped_size| is specified in bytes. The | 66 // |start_address| and |mapped_size|. |mapped_size| is specified in bytes. The |
65 // value returned is valid only if the given range is currently mmapped by the | 67 // value returned is valid only if the given range is currently mmapped by the |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 // background mode are disabled for testing. | 215 // background mode are disabled for testing. |
214 static bool is_black_hole_non_fatal_for_testing_; | 216 static bool is_black_hole_non_fatal_for_testing_; |
215 | 217 |
216 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 218 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
217 }; | 219 }; |
218 | 220 |
219 } // namespace trace_event | 221 } // namespace trace_event |
220 } // namespace base | 222 } // namespace base |
221 | 223 |
222 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 224 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
OLD | NEW |