| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "crash-reporter/kernel_collector.h" | 5 #include "crash-reporter/kernel_collector.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "crash-reporter/system_logging.h" | 10 #include "crash-reporter/system_logging.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 std::string signature; | 252 std::string signature; |
| 253 if (!ComputeKernelStackSignature(kernel_dump, &signature, false)) { | 253 if (!ComputeKernelStackSignature(kernel_dump, &signature, false)) { |
| 254 signature = kDefaultKernelStackSignature; | 254 signature = kDefaultKernelStackSignature; |
| 255 } | 255 } |
| 256 | 256 |
| 257 bool feedback = is_feedback_allowed_function_(); | 257 bool feedback = is_feedback_allowed_function_(); |
| 258 | 258 |
| 259 logger_->LogInfo("Received prior crash notification from " | 259 logger_->LogInfo("Received prior crash notification from " |
| 260 "kernel (signature %s) (%s)", | 260 "kernel (signature %s) (%s)", |
| 261 signature.c_str(), | 261 signature.c_str(), |
| 262 feedback ? "handling" : "ignoring"); | 262 feedback ? "handling" : "ignoring - no consent"); |
| 263 | 263 |
| 264 if (feedback) { | 264 if (feedback) { |
| 265 count_crash_function_(); | 265 count_crash_function_(); |
| 266 | 266 |
| 267 if (!GetCreatedCrashDirectoryByEuid(kRootUid, | 267 if (!GetCreatedCrashDirectoryByEuid(kRootUid, |
| 268 &root_crash_directory)) { | 268 &root_crash_directory, |
| 269 NULL)) { |
| 269 return true; | 270 return true; |
| 270 } | 271 } |
| 271 | 272 |
| 272 std::string dump_basename = | 273 std::string dump_basename = |
| 273 FormatDumpBasename(kKernelExecName, | 274 FormatDumpBasename(kKernelExecName, |
| 274 time(NULL), | 275 time(NULL), |
| 275 kKernelPid); | 276 kKernelPid); |
| 276 FilePath kernel_crash_path = root_crash_directory.Append( | 277 FilePath kernel_crash_path = root_crash_directory.Append( |
| 277 StringPrintf("%s.kcrash", dump_basename.c_str())); | 278 StringPrintf("%s.kcrash", dump_basename.c_str())); |
| 278 | 279 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 294 | 295 |
| 295 logger_->LogInfo("Stored kcrash to %s", | 296 logger_->LogInfo("Stored kcrash to %s", |
| 296 kernel_crash_path.value().c_str()); | 297 kernel_crash_path.value().c_str()); |
| 297 } | 298 } |
| 298 if (!ClearPreservedDump()) { | 299 if (!ClearPreservedDump()) { |
| 299 return false; | 300 return false; |
| 300 } | 301 } |
| 301 | 302 |
| 302 return true; | 303 return true; |
| 303 } | 304 } |
| OLD | NEW |