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

Unified Diff: components/browser_watcher/postmortem_report_collector.cc

Issue 2719343002: Get visibility into stability file accumulation (Closed)
Patch Set: jwd comment Created 3 years, 10 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_watcher/postmortem_report_collector.cc
diff --git a/components/browser_watcher/postmortem_report_collector.cc b/components/browser_watcher/postmortem_report_collector.cc
index 7f5bf1457b81517991d604bfc1a754b9ef75f950..837f0232974f6db15c8681b122e3198146e7e3fe 100644
--- a/components/browser_watcher/postmortem_report_collector.cc
+++ b/components/browser_watcher/postmortem_report_collector.cc
@@ -170,6 +170,8 @@ int PostmortemReportCollector::CollectAndSubmitForUpload(
// Collect the list of files to harvest.
std::vector<FilePath> debug_files = GetDebugStateFilePaths(
debug_info_dir, debug_file_pattern, excluded_debug_files);
+ UMA_HISTOGRAM_COUNTS_100("ActivityTracker.Collect.StabilityFileCount",
+ debug_files.size());
// Determine the crashpad client id.
crashpad::UUID client_id;
@@ -232,7 +234,7 @@ PostmortemReportCollector::CollectAndSubmit(
// The file was empty, or there was an error collecting the data. Detailed
// logging happens within the Collect function.
if (!base::DeleteFile(file, false))
- LOG(ERROR) << "Failed to delete " << file.value();
+ DLOG(ERROR) << "Failed to delete " << file.value();
return status;
}
DCHECK_NE(nullptr, report_proto.get());
@@ -242,7 +244,8 @@ PostmortemReportCollector::CollectAndSubmit(
CrashReportDatabase::OperationStatus database_status =
report_database->PrepareNewCrashReport(&new_report);
if (database_status != CrashReportDatabase::kNoError) {
- LOG(ERROR) << "PrepareNewCrashReport failed";
+ // Assume this is recoverable: not deleting the file.
+ DLOG(ERROR) << "PrepareNewCrashReport failed";
return PREPARE_NEW_CRASH_REPORT_FAILED;
}
CrashReportDatabase::CallErrorWritingCrashReport
@@ -251,6 +254,9 @@ PostmortemReportCollector::CollectAndSubmit(
// Write the report to a minidump.
if (!WriteReportToMinidump(report_proto.get(), client_id, new_report->uuid,
reinterpret_cast<FILE*>(new_report->handle))) {
+ // Assume this is not recoverable and delete the file.
+ if (!base::DeleteFile(file, false))
+ DLOG(ERROR) << "Failed to delete " << file.value();
return WRITE_TO_MINIDUMP_FAILED;
}
@@ -260,7 +266,7 @@ PostmortemReportCollector::CollectAndSubmit(
// cannot be deleted.
// TODO(manzagop): metrics for the number of non-deletable files.
if (!base::DeleteFile(file, false)) {
- LOG(ERROR) << "Failed to delete " << file.value();
+ DLOG(ERROR) << "Failed to delete " << file.value();
return DEBUG_FILE_DELETION_FAILED;
}
@@ -272,7 +278,7 @@ PostmortemReportCollector::CollectAndSubmit(
database_status = report_database->FinishedWritingCrashReport(
new_report, &unused_report_id);
if (database_status != CrashReportDatabase::kNoError) {
- LOG(ERROR) << "FinishedWritingCrashReport failed";
+ DLOG(ERROR) << "FinishedWritingCrashReport failed";
return FINISHED_WRITING_CRASH_REPORT_FAILED;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698