| 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 <string> | 5 #include <string> |
| 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/user_collector.h" | 10 #include "crash-reporter/user_collector.h" |
| 11 #include "metrics/metrics_library.h" | 11 #include "metrics/metrics_library.h" |
| 12 | 12 |
| 13 // This procfs file is used to cause kernel core file writing to | 13 // This procfs file is used to cause kernel core file writing to |
| 14 // instead pipe the core file into a user space process. See | 14 // instead pipe the core file into a user space process. See |
| 15 // core(5) man page. | 15 // core(5) man page. |
| 16 static const char kCorePatternFile[] = "/proc/sys/kernel/core_pattern"; | 16 static const char kCorePatternFile[] = "/proc/sys/kernel/core_pattern"; |
| 17 | 17 |
| 18 UserCollector::UserCollector() | 18 UserCollector::UserCollector() |
| 19 : core_pattern_file_(kCorePatternFile), | 19 : core_pattern_file_(kCorePatternFile), |
| 20 count_crash_function_(NULL), | 20 count_crash_function_(NULL), |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 void UserCollector::HandleCrash(int signal, int pid, const std::string &exec) { | 68 void UserCollector::HandleCrash(int signal, int pid, const std::string &exec) { |
| 69 CHECK(initialized_); | 69 CHECK(initialized_); |
| 70 logger_->LogWarning("Received crash notification for %s[%d] sig %d", | 70 logger_->LogWarning("Received crash notification for %s[%d] sig %d", |
| 71 exec.c_str(), pid, signal); | 71 exec.c_str(), pid, signal); |
| 72 | 72 |
| 73 if (is_feedback_allowed_function_()) { | 73 if (is_feedback_allowed_function_()) { |
| 74 count_crash_function_(); | 74 count_crash_function_(); |
| 75 } | 75 } |
| 76 } | 76 } |
| OLD | NEW |