• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 HIDUMPER_SERVICES_DUMPER_CONSTANT_H
16 #define HIDUMPER_SERVICES_DUMPER_CONSTANT_H
17 
18 #include <string>
19 #include <vector>
20 #include <iostream>
21 #include <memory>
22 
23 namespace OHOS {
24 namespace HiviewDFX {
25 enum DumperConstant {
26     NONE,
27     GROUP,        // group
28     DUMPER_BEGIN, // dumper begin
29     CPU_DUMPER,
30     FILE_DUMPER,
31     ENV_PARAM_DUMPER,
32     CMD_DUMPER,
33     PROPERTIES_DUMPER,
34     API_DUMPER,
35     LIST_DUMPER,
36     VERSION_DUMPER,
37     SA_DUMPER,
38     MEMORY_DUMPER,
39     JSHEAP_MEMORY_DUMPER,
40     CJHEAP_MEMORY_DUMPER,
41     STACK_DUMPER,
42     TRAFFIC_DUMPER,
43     IPC_STAT_DUMPER,
44     DUMPER_END,   // dumper end
45     FILTER_BEGIN, // filter begin
46     COLUMN_ROWS_FILTER,
47     FILE_FORMAT_DUMP_FILTER,
48     FILTER_END,   // filter end
49     OUTPUT_BEGIN, // output begin
50     STD_OUTPUT,
51     FILE_OUTPUT,
52     FD_OUTPUT,
53     ZIP_OUTPUT,
54     OUTPUT_END,  // output end
55     LEVEL_BEGIN, // level begin
56     LEVEL_NONE,
57     LEVEL_MIDDLE,
58     LEVEL_HIGH,
59     LEVEL_ALL,
60     LEVEL_END,       // level end
61     GROUPTYPE_BEGIN, // group type begin
62     GROUPTYPE_PID,   // pid of group type
63     GROUPTYPE_CPUID, // cpuid of group type
64     GROUPTYPE_END,   // group type end
65     LOOP,
66 };
67 
68 struct DumperSysEventParams {
69     int32_t errorCode;
70     int32_t callerPpid;
71     std::string opt;
72     std::string subOpt;
73     std::string target;
74     std::string arguments;
75     std::string errorMsg;
76 };
77 
78 
79 const std::string LOG_DEFAULT = "log.txt";
80 const std::string ZIP_FILEEXT = "zip";
81 const std::string ZIP_FOLDER = "/data/log/hidumper/";
82 const std::string HISYSEVENT_TMP_FILE = "/data/log/hidumper/hisysevent.tmp";
83 
84 const std::string RELEASE_MODE = "Release";
85 } // namespace HiviewDFX
86 } // namespace OHOS
87 #endif // HIDUMPER_SERVICES_DUMPER_CONSTANT_H
88