Index: base/debug/activity_analyzer.cc |
diff --git a/base/debug/activity_analyzer.cc b/base/debug/activity_analyzer.cc |
index e27e47e4d7d3635f874090a586c34b84d5d19ac3..19bb767112cb3b3b1837b01d67b7ab8e60113586 100644 |
--- a/base/debug/activity_analyzer.cc |
+++ b/base/debug/activity_analyzer.cc |
@@ -83,7 +83,9 @@ void ThreadActivityAnalyzer::AddGlobalInformation( |
GlobalActivityAnalyzer::GlobalActivityAnalyzer( |
std::unique_ptr<PersistentMemoryAllocator> allocator) |
- : allocator_(std::move(allocator)), allocator_iterator_(allocator_.get()) { |
+ : allocator_(std::move(allocator)), |
+ analysis_stamp_(0LL), |
+ allocator_iterator_(allocator_.get()) { |
DCHECK(allocator_); |
} |
@@ -232,7 +234,7 @@ std::vector<std::string> GlobalActivityAnalyzer::GetLogMessages() { |
} |
std::vector<GlobalActivityTracker::ModuleInfo> |
-GlobalActivityAnalyzer::GetModules() { |
+GlobalActivityAnalyzer::GetModules(int64_t pid) { |
std::vector<GlobalActivityTracker::ModuleInfo> modules; |
PersistentMemoryAllocator::Iterator iter(allocator_.get()); |
@@ -241,6 +243,13 @@ GlobalActivityAnalyzer::GetModules() { |
(record = |
iter.GetNextOfObject<GlobalActivityTracker::ModuleInfoRecord>()) != |
nullptr) { |
+ int64_t process_id; |
+ int64_t create_stamp; |
+ if (!OwningProcess::GetOwningProcessId(&record->owner, &process_id, |
+ &create_stamp) || |
+ pid != process_id || create_stamp > analysis_stamp_) { |
+ continue; |
+ } |
GlobalActivityTracker::ModuleInfo info; |
if (record->DecodeTo(&info, allocator_->GetAllocSize( |
allocator_->GetAsReference(record)))) { |