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_PROCESSES; 53 static const std::string CONFIG_GROUP_PROCESSES_ENG; 54 static const std::string CONFIG_GROUP_PROCESSES_PID; 55 static const std::string CONFIG_GROUP_PROCESSES_PID_ENG; 56 static const std::string CONFIG_GROUP_FAULT_LOG; 57 static const std::string CONFIG_GROUP_STACK; 58 static const std::string CONFIG_GROUP_TEST; 59 static const std::string CONFIG_DUMPER_LIST; 60 static const std::string CONFIG_DUMPER_LIST_; 61 static const std::string CONFIG_DUMPER_LIST_SERVICE; 62 static const std::string CONFIG_DUMPER_LIST_SYSTEM_ABILITY; 63 static const std::string CONFIG_DUMPER_LIST_SYSTEM; 64 static const std::string STR_ABILITY; 65 static const std::string STR_BASE; 66 static const std::string STR_SERVICE; 67 static const std::string STR_SYSTEM; 68 protected: 69 struct ItemCfg { 70 const std::string &name_; 71 const std::string &desc_; 72 const std::string &target_; 73 const std::string §ion_; 74 const int &class_; 75 const int &level_; 76 const int &loop_; 77 const std::string &filterCfg_; 78 }; 79 struct DumperCfg { 80 const std::string &name_; 81 const std::string &desc_; 82 const ItemCfg * const &list_; 83 const int &size_; 84 }; 85 struct GroupCfg { 86 const std::string &name_; 87 const std::string &desc_; 88 const std::string * const &list_; 89 const int &size_; 90 const int type_; // DumperConstant::NONE, GROUPTYPE_PID, GROUPTYPE_CPUID 91 const bool expand_; // true: expand; false: non-expand 92 }; 93 static const GroupCfg groups_[]; 94 static const int groupSum_; 95 static const DumperCfg dumpers_[]; 96 static const int dumperSum_; 97 static const int NEST_MAX; 98 private: 99 static const ItemCfg baseInfoDumper_[]; 100 static const ItemCfg versionDumper_[]; 101 static const ItemCfg kernelVersionDumper_[]; 102 static const ItemCfg cmdlineDumper_[]; 103 static const ItemCfg kernelWakeSourcesDumper_[]; 104 static const ItemCfg kernelCpufreqDumper_[]; 105 static const ItemCfg uptimeDumper_[]; 106 static const ItemCfg cpuUsageDumper_[]; 107 static const ItemCfg cpuFreqDumper_[]; 108 static const ItemCfg memDumper_[]; 109 static const ItemCfg envDumper_[]; 110 static const ItemCfg kernelModuleDumper_[]; 111 static const ItemCfg dumpFormatVersionDumper_[]; 112 static const ItemCfg slabinfoDumper_[]; 113 static const ItemCfg ldkslabinfoDumper_[]; 114 static const ItemCfg zoneinfoDumper_[]; 115 static const ItemCfg vmStatDumper_[]; 116 static const ItemCfg vmAllocInfoDumper_[]; 117 static const ItemCfg crashDumper_[]; 118 static const ItemCfg tombStoneDumper_[]; 119 static const ItemCfg kernelLogDumper_[]; 120 static const ItemCfg hilogDumper_[]; 121 static const ItemCfg portDumper_[]; 122 static const ItemCfg packetDumper_[]; 123 static const ItemCfg ipDumper_[]; 124 static const ItemCfg ipTableDumper_[]; 125 static const ItemCfg routeTableDumper_[]; 126 static const ItemCfg ipcDumper_[]; 127 static const ItemCfg ipRulesDumper_[]; 128 static const ItemCfg storageStateDumper_[]; 129 static const ItemCfg blockDumper_[]; 130 static const ItemCfg fileDumper_[]; 131 static const ItemCfg topIoDumper_[]; 132 static const ItemCfg ioDumper_[]; 133 static const ItemCfg trafficDumper_[]; 134 static const ItemCfg mountsDumper_[]; 135 static const ItemCfg threadsDumper_[]; 136 static const ItemCfg threadsPidDumper_[]; 137 static const ItemCfg smapDumper_[]; 138 static const ItemCfg mapDumper_[]; 139 static const ItemCfg blockChannelDumper_[]; 140 static const ItemCfg excuteTimeDumper_[]; 141 static const ItemCfg mountInfoDumper_[]; 142 static const ItemCfg systemAbilityDumper_[]; 143 static const ItemCfg stackDumper_[]; 144 static const ItemCfg listServiceDumper_[]; 145 static const ItemCfg listSystemAbilityDumper_[]; 146 static const ItemCfg listSystemDumper_[]; 147 static const ItemCfg testDumper_[]; 148 static const std::string cpuFreqGroup_[]; 149 static const std::string cpuUsageGroup_[]; 150 static const std::string logKernelGroup_[]; 151 static const std::string logHilogGroup_[]; 152 static const std::string logInitGroup_[]; 153 static const std::string memoryGroup_[]; 154 static const std::string storageGroup_[]; 155 static const std::string netGroup_[]; 156 static const std::string serviceGroup_[]; 157 static const std::string systemAbilityGroup_[]; 158 static const std::string systemBaseGroup_[]; 159 static const std::string storageIoGroup_[]; 160 static const std::string systemSystemGroup_[]; 161 static const std::string netTrafficGroup_[]; 162 static const std::string processesGroup_[]; 163 static const std::string processesGroup_eng_[]; 164 static const std::string processesPidGroup_[]; 165 static const std::string processesPidGroup_eng_[]; 166 static const std::string faultLogGroup_[]; 167 static const std::string stackGroup_[]; 168 static const std::string testGroup_[]; 169 static const std::string processesGroupMini_[]; 170 static const std::string processesGroupMini_eng_[]; 171 static const std::string processesPidGroupMini_[]; 172 static const std::string processesPidGroupMini_eng_[]; 173 static const std::string systemBaseCpuIdGroupMini_[]; 174 static const std::string systemSystemCpuIdGroupMini_[]; 175 static const std::string systemSystemPidGroupMini_[]; 176 }; 177 } // namespace HiviewDFX 178 } // namespace OHOS 179 #endif // HIDUMPER_SERVICES_CONFIG_DATA_H 180