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

Unified Diff: kernel_collector.cc

Issue 3436029: crash-reporter: Send OS version at time of crash and related improvements (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git
Patch Set: respond to petkov review Created 10 years, 3 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 | « kernel_collector.h ('k') | kernel_collector_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: kernel_collector.cc
diff --git a/kernel_collector.cc b/kernel_collector.cc
index 1a79c9d86758275303623d4ee6b4cf153413d593..f5e20b901b82dcac8e2731486ec4198538a7383d 100644
--- a/kernel_collector.cc
+++ b/kernel_collector.cc
@@ -66,17 +66,6 @@ bool KernelCollector::ClearPreservedDump() {
return true;
}
-FilePath KernelCollector::GetKernelCrashPath(
- const FilePath &root_crash_path,
- time_t timestamp) {
- std::string dump_basename =
- FormatDumpBasename(kKernelExecName,
- timestamp,
- kKernelPid);
- return root_crash_path.Append(
- StringPrintf("%s.kcrash", dump_basename.c_str()));
-}
-
bool KernelCollector::Collect() {
std::string kernel_dump;
FilePath root_crash_directory;
@@ -86,6 +75,8 @@ bool KernelCollector::Collect() {
if (kernel_dump.empty()) {
return false;
}
+ logger_->LogInfo("Received prior crash notification from kernel");
+
if (is_feedback_allowed_function_()) {
count_crash_function_();
@@ -94,8 +85,13 @@ bool KernelCollector::Collect() {
return true;
}
- FilePath kernel_crash_path = GetKernelCrashPath(root_crash_directory,
- time(NULL));
+ std::string dump_basename =
+ FormatDumpBasename(kKernelExecName,
+ time(NULL),
+ kKernelPid);
+ FilePath kernel_crash_path = root_crash_directory.Append(
+ StringPrintf("%s.kcrash", dump_basename.c_str()));
+
if (file_util::WriteFile(kernel_crash_path,
kernel_dump.data(),
kernel_dump.length()) !=
@@ -105,6 +101,11 @@ bool KernelCollector::Collect() {
return true;
}
+ WriteCrashMetaData(
+ root_crash_directory.Append(
+ StringPrintf("%s.meta", dump_basename.c_str())),
+ kKernelExecName);
+
logger_->LogInfo("Collected kernel crash diagnostics into %s",
kernel_crash_path.value().c_str());
} else {
« no previous file with comments | « kernel_collector.h ('k') | kernel_collector_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698