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 #ifndef _CRASH_REPORTER_USER_COLLECTOR_H_ | 5 #ifndef _CRASH_REPORTER_USER_COLLECTOR_H_ |
6 #define _CRASH_REPORTER_USER_COLLECTOR_H_ | 6 #define _CRASH_REPORTER_USER_COLLECTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 FilePath GetProcessPath(pid_t pid); | 76 FilePath GetProcessPath(pid_t pid); |
77 bool GetSymlinkTarget(const FilePath &symlink, | 77 bool GetSymlinkTarget(const FilePath &symlink, |
78 FilePath *target); | 78 FilePath *target); |
79 bool GetExecutableBaseNameFromPid(uid_t pid, | 79 bool GetExecutableBaseNameFromPid(uid_t pid, |
80 std::string *base_name); | 80 std::string *base_name); |
81 bool GetIdFromStatus(const char *prefix, | 81 bool GetIdFromStatus(const char *prefix, |
82 IdKind kind, | 82 IdKind kind, |
83 const std::string &status_contents, | 83 const std::string &status_contents, |
84 int *id); | 84 int *id); |
| 85 |
| 86 void LogCollectionError(const std::string &error_message); |
| 87 void EnqueueCollectionErrorLog(pid_t pid, const std::string &exec_name); |
| 88 |
85 bool CopyOffProcFiles(pid_t pid, const FilePath &process_map); | 89 bool CopyOffProcFiles(pid_t pid, const FilePath &process_map); |
86 // Determines the crash directory for given pid based on pid's owner, | 90 // Determines the crash directory for given pid based on pid's owner, |
87 // and creates the directory if necessary with appropriate permissions. | 91 // and creates the directory if necessary with appropriate permissions. |
88 // Returns true whether or not directory needed to be created, false on | 92 // Returns true whether or not directory needed to be created, false on |
89 // any failure. | 93 // any failure. |
90 bool GetCreatedCrashDirectory(pid_t pid, | 94 bool GetCreatedCrashDirectory(pid_t pid, |
91 FilePath *crash_file_path); | 95 FilePath *crash_file_path, |
| 96 bool *out_of_capacity); |
92 bool CopyStdinToCoreFile(const FilePath &core_path); | 97 bool CopyStdinToCoreFile(const FilePath &core_path); |
93 int ForkExecAndPipe(std::vector<const char *> &arguments, | 98 int ForkExecAndPipe(std::vector<const char *> &arguments, |
94 const char *output_file); | 99 const char *output_file); |
95 bool ConvertCoreToMinidump(const FilePath &core_path, | 100 bool RunCoreToMinidump(const FilePath &core_path, |
96 const FilePath &procfs_directory, | 101 const FilePath &procfs_directory, |
97 const FilePath &minidump_path, | 102 const FilePath &minidump_path, |
98 const FilePath &temp_directory); | 103 const FilePath &temp_directory); |
99 bool GenerateDiagnostics(pid_t pid, const std::string &exec_name); | 104 bool ConvertCoreToMinidump(pid_t pid, |
| 105 const FilePath &container_dir, |
| 106 const FilePath &core_path, |
| 107 const FilePath &minidump_path); |
| 108 bool ConvertAndEnqueueCrash(int pid, const std::string &exec_name, |
| 109 bool *out_of_capacity); |
100 | 110 |
101 bool generate_diagnostics_; | 111 bool generate_diagnostics_; |
102 std::string core_pattern_file_; | 112 std::string core_pattern_file_; |
103 std::string our_path_; | 113 std::string our_path_; |
104 bool initialized_; | 114 bool initialized_; |
105 | 115 |
| 116 // String containing the current log of crash handling errors. |
| 117 std::string error_log_; |
| 118 |
106 static const char *kUserId; | 119 static const char *kUserId; |
107 static const char *kGroupId; | 120 static const char *kGroupId; |
108 }; | 121 }; |
109 | 122 |
110 #endif // _CRASH_REPORTER_USER_COLLECTOR_H_ | 123 #endif // _CRASH_REPORTER_USER_COLLECTOR_H_ |
OLD | NEW |