Index: base/debug/activity_analyzer.cc |
diff --git a/base/debug/activity_analyzer.cc b/base/debug/activity_analyzer.cc |
index 6a483f38fba78dd6c06e7b4c2b8517d4be1f43a4..644511720d0222969ce0df03225643621a3bca70 100644 |
--- a/base/debug/activity_analyzer.cc |
+++ b/base/debug/activity_analyzer.cc |
@@ -159,6 +159,27 @@ std::vector<std::string> GlobalActivityAnalyzer::GetLogMessages() { |
return messages; |
} |
+std::vector<GlobalActivityTracker::ModuleInfo> |
+GlobalActivityAnalyzer::GetModules() { |
+ std::vector<GlobalActivityTracker::ModuleInfo> modules; |
+ PersistentMemoryAllocator::Reference ref; |
+ |
+ PersistentMemoryAllocator::Iterator iter(allocator_.get()); |
+ while ((ref = iter.GetNextOfType( |
+ GlobalActivityTracker::kTypeIdModuleInfoRecord)) != 0) { |
+ const GlobalActivityTracker::ModuleInfoRecord* record = |
+ allocator_->GetAsObject<GlobalActivityTracker::ModuleInfoRecord>( |
+ ref, GlobalActivityTracker::kTypeIdModuleInfoRecord); |
+ if (record) { |
+ GlobalActivityTracker::ModuleInfo info; |
+ record->DecodeTo(&info, allocator_->GetAllocSize(ref)); |
+ modules.push_back(std::move(info)); |
+ } |
+ } |
+ |
+ return modules; |
+} |
+ |
GlobalActivityAnalyzer::ProgramLocation |
GlobalActivityAnalyzer::GetProgramLocationFromAddress(uint64_t address) { |
// TODO(bcwhite): Implement this. |