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

Unified Diff: base/debug/activity_analyzer.cc

Issue 2966563004: StabilityReport proto changes for multi-process support (Closed)
Patch Set: Merge Created 3 years, 4 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 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)))) {
« 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