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/user_collector.h" |
11 #include "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), |
21 initialized_(false), | 21 initialized_(false), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 void UserCollector::HandleCrash(int signal, int pid, const std::string &exec) { | 67 void UserCollector::HandleCrash(int signal, int pid, const std::string &exec) { |
68 CHECK(initialized_); | 68 CHECK(initialized_); |
69 logger_->LogWarning("Received crash notification for %s[%d] sig %d", | 69 logger_->LogWarning("Received crash notification for %s[%d] sig %d", |
70 exec.c_str(), pid, signal); | 70 exec.c_str(), pid, signal); |
71 | 71 |
72 if (is_feedback_allowed_function_()) { | 72 if (is_feedback_allowed_function_()) { |
73 count_crash_function_(); | 73 count_crash_function_(); |
74 } | 74 } |
75 } | 75 } |
OLD | NEW |