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_CONFIG_DATA_H
16 #define HIDUMPER_SERVICES_CONFIG_DATA_H
17 #include <string>
18 namespace OHOS {
19 namespace HiviewDFX {
20 class ConfigData {
21 public:
22     ConfigData();
23     ~ConfigData();
24     static const std::string CONFIG_NAME_SPLIT;
25     static const std::string CONFIG_GROUP;
26     static const std::string CONFIG_GROUP_;
27     static const std::string CONFIG_MINIGROUP;
28     static const std::string CONFIG_MINIGROUP_;
29     static const std::string CONFIG_DUMPER;
30     static const std::string CONFIG_DUMPER_;
31     static const std::string CONFIG_NAME_BASE;
32     static const std::string CONFIG_NAME_SYSTEM;
33     static const std::string CONFIG_NAME_ABILITY;
34     static const std::string CONFIG_GROUP_CPU_FREQ;
35     static const std::string CONFIG_GROUP_CPU_USAGE;
36     static const std::string CONFIG_GROUP_LOG;
37     static const std::string CONFIG_GROUP_LOG_;
38     static const std::string CONFIG_GROUP_LOG_KERNEL;
39     static const std::string CONFIG_GROUP_LOG_HILOG;
40     static const std::string CONFIG_GROUP_LOG_INIT;
41     static const std::string CONFIG_GROUP_MEMORY;
42     static const std::string CONFIG_GROUP_STORAGE;
43     static const std::string CONFIG_GROUP_NET;
44     static const std::string CONFIG_GROUP_SERVICE;
45     static const std::string CONFIG_GROUP_ABILITY;
46     static const std::string CONFIG_GROUP_SYSTEM;
47     static const std::string CONFIG_GROUP_SYSTEM_;
48     static const std::string CONFIG_GROUP_SYSTEM_BASE;
49     static const std::string CONFIG_GROUP_SYSTEM_SYSTEM;
50     static const std::string CONFIG_GROUP_STORAGE_IO;
51     static const std::string CONFIG_GROUP_NET_TRAFFIC;
52     static const std::string CONFIG_GROUP_IPC_STAT;
53     static const std::string CONFIG_GROUP_PROCESSES;
54     static const std::string CONFIG_GROUP_PROCESSES_ENG;
55     static const std::string CONFIG_GROUP_PROCESSES_PID;
56     static const std::string CONFIG_GROUP_PROCESSES_PID_ENG;
57     static const std::string CONFIG_GROUP_FAULT_LOG;
58     static const std::string CONFIG_GROUP_STACK;
59     static const std::string CONFIG_GROUP_TEST;
60     static const std::string CONFIG_DUMPER_LIST;
61     static const std::string CONFIG_DUMPER_LIST_;
62     static const std::string CONFIG_DUMPER_LIST_SERVICE;
63     static const std::string CONFIG_DUMPER_LIST_SYSTEM_ABILITY;
64     static const std::string CONFIG_DUMPER_LIST_SYSTEM;
65     static const std::string CONFIG_DUMPER_JSHEAP_MEMORY;
66     static const std::string STR_ABILITY;
67     static const std::string STR_BASE;
68     static const std::string STR_SERVICE;
69     static const std::string STR_SYSTEM;
70 protected:
71     struct ItemCfg {
72         const std::string &name_;
73         const std::string &desc_;
74         const std::string &target_;
75         const std::string &section_;
76         const int &class_;
77         const int &level_;
78         const int &loop_;
79         const std::string &filterCfg_;
80     };
81     struct DumperCfg {
82         const std::string &name_;
83         const std::string &desc_;
84         const ItemCfg * const &list_;
85         const int &size_;
86     };
87     struct GroupCfg {
88         const std::string &name_;
89         const std::string &desc_;
90         const std::string * const &list_;
91         const int &size_;
92         const int type_; // DumperConstant::NONE, GROUPTYPE_PID, GROUPTYPE_CPUID
93         const bool expand_; // true: expand; false: non-expand
94     };
95     static const GroupCfg groups_[];
96     static const int groupSum_;
97     static const DumperCfg dumpers_[];
98     static const int dumperSum_;
99     static const int NEST_MAX;
100 private:
101     static const ItemCfg baseInfoDumper_[];
102     static const ItemCfg versionDumper_[];
103     static const ItemCfg kernelVersionDumper_[];
104     static const ItemCfg cmdlineDumper_[];
105     static const ItemCfg kernelWakeSourcesDumper_[];
106     static const ItemCfg kernelCpufreqDumper_[];
107     static const ItemCfg uptimeDumper_[];
108     static const ItemCfg cpuUsageDumper_[];
109     static const ItemCfg cpuFreqDumper_[];
110     static const ItemCfg memDumper_[];
111     static const ItemCfg jsHeapMemDumper_[];
112     static const ItemCfg envDumper_[];
113     static const ItemCfg kernelModuleDumper_[];
114     static const ItemCfg dumpFormatVersionDumper_[];
115     static const ItemCfg slabinfoDumper_[];
116     static const ItemCfg ldkslabinfoDumper_[];
117     static const ItemCfg zoneinfoDumper_[];
118     static const ItemCfg vmStatDumper_[];
119     static const ItemCfg vmAllocInfoDumper_[];
120     static const ItemCfg crashDumper_[];
121     static const ItemCfg tombStoneDumper_[];
122     static const ItemCfg kernelLogDumper_[];
123     static const ItemCfg hilogDumper_[];
124     static const ItemCfg portDumper_[];
125     static const ItemCfg packetDumper_[];
126     static const ItemCfg ipDumper_[];
127     static const ItemCfg ipTableDumper_[];
128     static const ItemCfg routeTableDumper_[];
129     static const ItemCfg ipcDumper_[];
130     static const ItemCfg ipRulesDumper_[];
131     static const ItemCfg storageStateDumper_[];
132     static const ItemCfg blockDumper_[];
133     static const ItemCfg fileDumper_[];
134     static const ItemCfg topIoDumper_[];
135     static const ItemCfg ioDumper_[];
136     static const ItemCfg trafficDumper_[];
137     static const ItemCfg ipcStatDumper_[];
138     static const ItemCfg mountsDumper_[];
139     static const ItemCfg threadsDumper_[];
140     static const ItemCfg threadsPidDumper_[];
141     static const ItemCfg smapDumper_[];
142     static const ItemCfg mapDumper_[];
143     static const ItemCfg blockChannelDumper_[];
144     static const ItemCfg excuteTimeDumper_[];
145     static const ItemCfg mountInfoDumper_[];
146     static const ItemCfg systemAbilityDumper_[];
147     static const ItemCfg stackDumper_[];
148     static const ItemCfg listServiceDumper_[];
149     static const ItemCfg listSystemAbilityDumper_[];
150     static const ItemCfg listSystemDumper_[];
151     static const ItemCfg testDumper_[];
152     static const std::string cpuFreqGroup_[];
153     static const std::string cpuUsageGroup_[];
154     static const std::string logKernelGroup_[];
155     static const std::string logHilogGroup_[];
156     static const std::string logInitGroup_[];
157     static const std::string memoryGroup_[];
158     static const std::string storageGroup_[];
159     static const std::string netGroup_[];
160     static const std::string serviceGroup_[];
161     static const std::string systemAbilityGroup_[];
162     static const std::string systemBaseGroup_[];
163     static const std::string storageIoGroup_[];
164     static const std::string systemSystemGroup_[];
165     static const std::string netTrafficGroup_[];
166     static const std::string ipcStatGroup_[];
167     static const std::string processesGroup_[];
168     static const std::string processesGroup_eng_[];
169     static const std::string processesPidGroup_[];
170     static const std::string processesPidGroup_eng_[];
171     static const std::string faultLogGroup_[];
172     static const std::string stackGroup_[];
173     static const std::string testGroup_[];
174     static const std::string processesGroupMini_[];
175     static const std::string processesGroupMini_eng_[];
176     static const std::string processesPidGroupMini_[];
177     static const std::string processesPidGroupMini_eng_[];
178     static const std::string systemBaseCpuIdGroupMini_[];
179     static const std::string systemSystemCpuIdGroupMini_[];
180     static const std::string systemSystemPidGroupMini_[];
181 };
182 } // namespace HiviewDFX
183 } // namespace OHOS
184 #endif // HIDUMPER_SERVICES_CONFIG_DATA_H
185