| 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 #include "base/trace_event/process_memory_dump.h" | 5 #include "base/trace_event/process_memory_dump.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/process/process_metrics.h" | 10 #include "base/process/process_metrics.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 DCHECK(!failure); | 114 DCHECK(!failure); |
| 115 if (failure) { | 115 if (failure) { |
| 116 total_resident_size = 0; | 116 total_resident_size = 0; |
| 117 LOG(ERROR) << "CountResidentBytes failed. The resident size is invalid"; | 117 LOG(ERROR) << "CountResidentBytes failed. The resident size is invalid"; |
| 118 } | 118 } |
| 119 return total_resident_size; | 119 return total_resident_size; |
| 120 } | 120 } |
| 121 #endif // defined(COUNT_RESIDENT_BYTES_SUPPORTED) | 121 #endif // defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
| 122 | 122 |
| 123 ProcessMemoryDump::ProcessMemoryDump( | 123 ProcessMemoryDump::ProcessMemoryDump( |
| 124 const scoped_refptr<MemoryDumpSessionState>& session_state) | 124 scoped_refptr<MemoryDumpSessionState> session_state) |
| 125 : has_process_totals_(false), | 125 : has_process_totals_(false), |
| 126 has_process_mmaps_(false), | 126 has_process_mmaps_(false), |
| 127 session_state_(session_state) {} | 127 session_state_(std::move(session_state)) {} |
| 128 | 128 |
| 129 ProcessMemoryDump::~ProcessMemoryDump() {} | 129 ProcessMemoryDump::~ProcessMemoryDump() {} |
| 130 | 130 |
| 131 MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump( | 131 MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump( |
| 132 const std::string& absolute_name) { | 132 const std::string& absolute_name) { |
| 133 return AddAllocatorDumpInternal( | 133 return AddAllocatorDumpInternal( |
| 134 make_scoped_ptr(new MemoryAllocatorDump(absolute_name, this))); | 134 make_scoped_ptr(new MemoryAllocatorDump(absolute_name, this))); |
| 135 } | 135 } |
| 136 | 136 |
| 137 MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump( | 137 MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump( |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 void ProcessMemoryDump::AddSuballocation(const MemoryAllocatorDumpGuid& source, | 289 void ProcessMemoryDump::AddSuballocation(const MemoryAllocatorDumpGuid& source, |
| 290 const std::string& target_node_name) { | 290 const std::string& target_node_name) { |
| 291 std::string child_mad_name = target_node_name + "/__" + source.ToString(); | 291 std::string child_mad_name = target_node_name + "/__" + source.ToString(); |
| 292 MemoryAllocatorDump* target_child_mad = CreateAllocatorDump(child_mad_name); | 292 MemoryAllocatorDump* target_child_mad = CreateAllocatorDump(child_mad_name); |
| 293 AddOwnershipEdge(source, target_child_mad->guid()); | 293 AddOwnershipEdge(source, target_child_mad->guid()); |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace trace_event | 296 } // namespace trace_event |
| 297 } // namespace base | 297 } // namespace base |
| OLD | NEW |