Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 34 MemoryAllocatorDumpGuid target; | 34 MemoryAllocatorDumpGuid target; |
| 35 int importance; | 35 int importance; |
| 36 const char* type; | 36 const char* type; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // Maps allocator dumps absolute names (allocator_name/heap/subheap) to | 39 // Maps allocator dumps absolute names (allocator_name/heap/subheap) to |
| 40 // MemoryAllocatorDump instances. | 40 // MemoryAllocatorDump instances. |
| 41 using AllocatorDumpsMap = | 41 using AllocatorDumpsMap = |
| 42 SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; | 42 SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; |
| 43 | 43 |
| 44 // Returns the total bytes resident for a memory segment, with given | |
| 45 // |start_address| and |mapped_size|. |mapped_size| is specified in bytes. The | |
| 46 // value returned is valid only if the given range is currently mmapped by the | |
| 47 // process. Returns -1 if counting is not implemented in the current platform. | |
|
reveman
2015/10/07 09:40:04
Can we have a IsCountResidentBytesSupported() func
| |
| 48 static int64 CountResidentBytes(void* start_address, size_t mapped_size); | |
| 49 | |
| 44 ProcessMemoryDump(const scoped_refptr<MemoryDumpSessionState>& session_state); | 50 ProcessMemoryDump(const scoped_refptr<MemoryDumpSessionState>& session_state); |
| 45 ~ProcessMemoryDump(); | 51 ~ProcessMemoryDump(); |
| 46 | 52 |
| 47 // Creates a new MemoryAllocatorDump with the given name and returns the | 53 // Creates a new MemoryAllocatorDump with the given name and returns the |
| 48 // empty object back to the caller. | 54 // empty object back to the caller. |
| 49 // Arguments: | 55 // Arguments: |
| 50 // absolute_name: a name that uniquely identifies allocator dumps produced | 56 // absolute_name: a name that uniquely identifies allocator dumps produced |
| 51 // by this provider. It is possible to specify nesting by using a | 57 // by this provider. It is possible to specify nesting by using a |
| 52 // path-like string (e.g., v8/isolate1/heap1, v8/isolate1/heap2). | 58 // path-like string (e.g., v8/isolate1/heap1, v8/isolate1/heap2). |
| 53 // Leading or trailing slashes are not allowed. | 59 // Leading or trailing slashes are not allowed. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 // Keeps track of relationships between MemoryAllocatorDump(s). | 154 // Keeps track of relationships between MemoryAllocatorDump(s). |
| 149 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; | 155 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; |
| 150 | 156 |
| 151 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 157 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
| 152 }; | 158 }; |
| 153 | 159 |
| 154 } // namespace trace_event | 160 } // namespace trace_event |
| 155 } // namespace base | 161 } // namespace base |
| 156 | 162 |
| 157 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 163 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
| OLD | NEW |