1 /*
2  * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef HIVIEW_FAULT_LOG_INFO_H
16 #define HIVIEW_FAULT_LOG_INFO_H
17 #include <cinttypes>
18 #include <list>
19 #include <map>
20 #include <string>
21 
22 namespace OHOS {
23 namespace HiviewDFX {
24 struct FaultLogInfo {
25     int64_t time {0};
26     int32_t id {0};
27     int32_t pid {0};
28     std::shared_ptr<int32_t> pipeFd;
29     int32_t faultLogType {0};
30     int32_t fd = {-1};
31     std::string module;
32     std::string reason;
33     std::string summary;
34     std::string logPath;
35     std::string registers;
36     std::string otherThreadInfo;
37     std::map<std::string, std::string> sectionMap;
38     std::list<std::string> additionalLogs;
39     std::map<std::string, std::string> parsedLogInfo;
40 };
41 
42 enum FaultLogType {
43     ALL = 0,
44     CPP_CRASH = 2,
45     JS_CRASH,
46     APP_FREEZE,
47     SYS_FREEZE,
48     SYS_WARNING,
49     RUST_PANIC,
50     ADDR_SANITIZER,
51 };
52 }  // namespace HiviewDFX
53 }  // namespace OHOS
54 #endif  // HIVIEW_FAULT_LOG_INFO_H
55