OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_MAPS_H_ |
| 6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_MAPS_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/base_export.h" |
| 12 #include "base/basictypes.h" |
| 13 |
| 14 namespace base { |
| 15 namespace trace_event { |
| 16 |
| 17 class TracedValue; |
| 18 |
| 19 // Data model for process-wide memory stats. |
| 20 class BASE_EXPORT ProcessMemoryMaps { |
| 21 public: |
| 22 struct VMRegion { |
| 23 static const uint32 kProtectionFlagsRead; |
| 24 static const uint32 kProtectionFlagsWrite; |
| 25 static const uint32 kProtectionFlagsExec; |
| 26 |
| 27 uint64 start_address; |
| 28 uint64 size_in_bytes; |
| 29 uint32 protection_flags; |
| 30 std::string mapped_file; |
| 31 uint64 mapped_file_offset; |
| 32 uint64 byte_stats_resident; |
| 33 uint64 byte_stats_anonymous; |
| 34 }; |
| 35 |
| 36 ProcessMemoryMaps(); |
| 37 ~ProcessMemoryMaps(); |
| 38 |
| 39 void AddVMRegion(const VMRegion& region) { vm_regions_.push_back(region); } |
| 40 const std::vector<VMRegion>& vm_regions() const { return vm_regions_; } |
| 41 |
| 42 // Called at trace generation time to populate the TracedValue. |
| 43 void AsValueInto(TracedValue* value) const; |
| 44 |
| 45 private: |
| 46 std::vector<VMRegion> vm_regions_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryMaps); |
| 49 }; |
| 50 |
| 51 } // namespace trace_event |
| 52 } // namespace base |
| 53 |
| 54 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_MAPS_H_ |
OLD | NEW |