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

Unified Diff: crash_collector.cc

Issue 4018008: crash-reporter: Generate kernel crash signatures for server-side grouping of similar crashes (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git
Patch Set: Respond to petkov review 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_collector_test.cc » ('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 0391fa541d900b98a901d27257b340fff199e591..5ea06e288798f2fb76a9a26eaff3214884ed1dd9 100644
--- a/crash_collector.cc
+++ b/crash_collector.cc
@@ -39,7 +39,9 @@ static const uid_t kRootGroup = 0;
// number of core files or minidumps reaches this number.
const int CrashCollector::kMaxCrashDirectorySize = 32;
-CrashCollector::CrashCollector() : forced_crash_directory_(NULL) {
+CrashCollector::CrashCollector()
+ : forced_crash_directory_(NULL),
+ lsb_release_(kLsbRelease) {
}
CrashCollector::~CrashCollector() {
@@ -247,12 +249,17 @@ bool CrashCollector::ReadKeyValueFile(
return !any_errors;
}
+void CrashCollector::AddCrashMetaData(const std::string &key,
+ const std::string &value) {
+ extra_metadata_.append(StringPrintf("%s=%s\n", key.c_str(), value.c_str()));
+}
+
void CrashCollector::WriteCrashMetaData(const FilePath &meta_path,
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);
+ if (!ReadKeyValueFile(FilePath(std::string(lsb_release_)), '=', &contents)) {
+ logger_->LogError("Problem parsing %s", lsb_release_);
// Even though there was some failure, take as much as we could read.
}
std::string version("unknown");
@@ -262,10 +269,11 @@ void CrashCollector::WriteCrashMetaData(const FilePath &meta_path,
}
int64 payload_size = -1;
file_util::GetFileSize(FilePath(payload_path), &payload_size);
- std::string meta_data = StringPrintf("exec_name=%s\n"
+ std::string meta_data = StringPrintf("%sexec_name=%s\n"
"ver=%s\n"
"payload_size=%lld\n"
"done=1\n",
+ extra_metadata_.c_str(),
exec_name.c_str(),
version.c_str(),
payload_size);
« no previous file with comments | « crash_collector.h ('k') | crash_collector_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698