Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2636)

Unified Diff: base/debug/activity_analyzer.cc

Issue 2566983009: Support storing information about what modules are loaded in the process. (Closed)
Patch Set: rebased Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698