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

Unified Diff: components/browser_watcher/postmortem_report_extractor.cc

Issue 2754483002: Add analyzer support for multiple processes. (Closed)
Patch Set: rebased Created 3 years, 9 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
« base/debug/activity_tracker.cc ('K') | « base/debug/activity_tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_watcher/postmortem_report_extractor.cc
diff --git a/components/browser_watcher/postmortem_report_extractor.cc b/components/browser_watcher/postmortem_report_extractor.cc
index bd12a9a03b4b87f9892195c6a3806bd1d6fce629..70c4a8d374ad43f165904420853508c92c3b5e88 100644
--- a/components/browser_watcher/postmortem_report_extractor.cc
+++ b/components/browser_watcher/postmortem_report_extractor.cc
@@ -216,8 +216,13 @@ CollectionStatus Extract(const base::FilePath& stability_file,
// Early exit if there is no data.
std::vector<std::string> log_messages = global_analyzer->GetLogMessages();
ActivityUserData::Snapshot global_data_snapshot =
- global_analyzer->GetGlobalUserDataSnapshot();
- ThreadActivityAnalyzer* thread_analyzer = global_analyzer->GetFirstAnalyzer();
+ global_analyzer->GetGlobalDataSnapshot();
+
+ // Extract data for only the first process.
+ // TODO(manzagop): Extend this to all processes.
+ int64_t pid = global_analyzer->GetFirstProcess();
+ ThreadActivityAnalyzer* thread_analyzer =
+ global_analyzer->GetFirstAnalyzer(pid);
if (log_messages.empty() && global_data_snapshot.empty() &&
!thread_analyzer) {
return DEBUG_FILE_NO_DATA;
@@ -237,7 +242,7 @@ CollectionStatus Extract(const base::FilePath& stability_file,
// Note: a single process is instrumented.
ProcessState* process_state = report->add_process_states();
for (; thread_analyzer != nullptr;
- thread_analyzer = global_analyzer->GetNextAnalyzer()) {
+ thread_analyzer = global_analyzer->GetNextAnalyzer(pid)) {
// Only valid analyzers are expected per contract of GetFirstAnalyzer /
// GetNextAnalyzer.
DCHECK(thread_analyzer->IsValid());
« base/debug/activity_tracker.cc ('K') | « base/debug/activity_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698