• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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     uint32_t logFileCutoffSizeBytes {0};
32     std::string module;
33     std::string reason;
34     std::string summary;
35     std::string logPath;
36     std::string registers;
37     std::string otherThreadInfo;
38     std::string sanitizerType;
39     std::map<std::string, std::string> sectionMap;
40     std::list<std::string> additionalLogs;
41     std::map<std::string, std::string> parsedLogInfo;
42     bool dumpLogToFaultlogger {true};
43     bool reportToAppEvent {true};
44 };
45 
46 enum FaultLogType {
47     ALL = 0,
48     CPP_CRASH = 2,
49     JS_CRASH,
50     APP_FREEZE,
51     SYS_FREEZE,
52     SYS_WARNING,
53     RUST_PANIC,
54     ADDR_SANITIZER,
55     CJ_ERROR,
56 };
57 }  // namespace HiviewDFX
58 }  // namespace OHOS
59 #endif  // HIVIEW_FAULT_LOG_INFO_H
60