Chromium Code Reviews| Index: base/trace_event/process_memory_dump.h |
| diff --git a/base/trace_event/process_memory_dump.h b/base/trace_event/process_memory_dump.h |
| index da18a14b1ca1d2909224011fcb5bc89d0286b69e..f4bc8ead79beaa98f0900eb6b60380dfb08ddea9 100644 |
| --- a/base/trace_event/process_memory_dump.h |
| +++ b/base/trace_event/process_memory_dump.h |
| @@ -18,6 +18,12 @@ |
| #include "base/trace_event/process_memory_maps.h" |
| #include "base/trace_event/process_memory_totals.h" |
| +// Define COUNT_RESIDENT_BYTES_SUPPORTED if platform supports counting of the |
| +// resident memory. |
| +#if defined(OS_POSIX) && !defined(OS_NACL) |
| +#define COUNT_RESIDENT_BYTES_SUPPORTED |
| +#endif |
| + |
| namespace base { |
| namespace trace_event { |
| @@ -41,6 +47,14 @@ class BASE_EXPORT ProcessMemoryDump { |
| using AllocatorDumpsMap = |
| SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; |
| +#if defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
| + // Returns the total bytes resident for a memory segment, with given |
|
Primiano Tucci (use gerrit)
2015/10/07 13:59:51
s/a memory segment/a virtual address range/
ssid
2015/10/07 14:46:45
Done.
|
| + // |start_address| and |mapped_size|. |mapped_size| is specified in bytes. The |
| + // value returned is valid only if the given range is currently mmapped by the |
| + // process. |
| + static size_t CountResidentBytes(void* start_address, size_t mapped_size); |
| +#endif |
| + |
| ProcessMemoryDump(const scoped_refptr<MemoryDumpSessionState>& session_state); |
| ~ProcessMemoryDump(); |