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