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

Unified Diff: base/debug/activity_analyzer.cc

Issue 2566983009: Support storing information about what modules are loaded in the process. (Closed)
Patch Set: changed GUID to generic 'identifier'; noted it and others as 'opaque' with no defined meaning Created 3 years, 11 months 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
« no previous file with comments | « base/debug/activity_analyzer.h ('k') | base/debug/activity_analyzer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/activity_analyzer.cc
diff --git a/base/debug/activity_analyzer.cc b/base/debug/activity_analyzer.cc
index 6a483f38fba78dd6c06e7b4c2b8517d4be1f43a4..7c421e9630922a9135baae81bae052d3e21fb7d7 100644
--- a/base/debug/activity_analyzer.cc
+++ b/base/debug/activity_analyzer.cc
@@ -31,7 +31,7 @@ ThreadActivityAnalyzer::ThreadActivityAnalyzer(
: ThreadActivityAnalyzer(allocator->GetAsArray<char>(
reference,
GlobalActivityTracker::kTypeIdActivityTracker,
- 1),
+ PersistentMemoryAllocator::kSizeAny),
allocator->GetAllocSize(reference)) {}
ThreadActivityAnalyzer::~ThreadActivityAnalyzer() {}
@@ -159,6 +159,26 @@ std::vector<std::string> GlobalActivityAnalyzer::GetLogMessages() {
return messages;
}
+std::vector<GlobalActivityTracker::ModuleInfo>
+GlobalActivityAnalyzer::GetModules() {
+ std::vector<GlobalActivityTracker::ModuleInfo> modules;
+
+ PersistentMemoryAllocator::Iterator iter(allocator_.get());
+ const GlobalActivityTracker::ModuleInfoRecord* record;
+ while (
+ (record =
+ iter.GetNextOfObject<GlobalActivityTracker::ModuleInfoRecord>()) !=
+ nullptr) {
+ GlobalActivityTracker::ModuleInfo info;
+ if (record->DecodeTo(&info, allocator_->GetAllocSize(
+ allocator_->GetAsReference(record)))) {
+ modules.push_back(std::move(info));
+ }
+ }
+
+ return modules;
+}
+
GlobalActivityAnalyzer::ProgramLocation
GlobalActivityAnalyzer::GetProgramLocationFromAddress(uint64_t address) {
// TODO(bcwhite): Implement this.
« no previous file with comments | « base/debug/activity_analyzer.h ('k') | base/debug/activity_analyzer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698