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

Unified Diff: crash_collector.cc

Issue 3820004: crash-reporter: send payload sizes to help diagnose corruption (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git
Patch Set: Created 10 years, 2 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 | « crash_collector.h ('k') | crash_sender » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crash_collector.cc
diff --git a/crash_collector.cc b/crash_collector.cc
index e91f70a12056975a50212506ac67dd2cb807198b..0391fa541d900b98a901d27257b340fff199e591 100644
--- a/crash_collector.cc
+++ b/crash_collector.cc
@@ -248,7 +248,8 @@ bool CrashCollector::ReadKeyValueFile(
}
void CrashCollector::WriteCrashMetaData(const FilePath &meta_path,
- const std::string &exec_name) {
+ const std::string &exec_name,
+ const std::string &payload_path) {
std::map<std::string, std::string> contents;
if (!ReadKeyValueFile(FilePath(std::string(kLsbRelease)), '=', &contents)) {
logger_->LogError("Problem parsing %s", kLsbRelease);
@@ -259,11 +260,15 @@ void CrashCollector::WriteCrashMetaData(const FilePath &meta_path,
if ((i = contents.find("CHROMEOS_RELEASE_VERSION")) != contents.end()) {
version = i->second;
}
+ int64 payload_size = -1;
+ file_util::GetFileSize(FilePath(payload_path), &payload_size);
std::string meta_data = StringPrintf("exec_name=%s\n"
"ver=%s\n"
+ "payload_size=%lld\n"
"done=1\n",
exec_name.c_str(),
- version.c_str());
+ version.c_str(),
+ payload_size);
if (!file_util::WriteFile(meta_path, meta_data.c_str(), meta_data.size())) {
logger_->LogError("Unable to write %s", meta_path.value().c_str());
}
« no previous file with comments | « crash_collector.h ('k') | crash_sender » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698