1/* 2 * Copyright (C) 2022 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 16import {TabPaneCurrentSelection} from "../sheet/TabPaneCurrentSelection.js"; 17import {TabPaneFreq} from "../sheet/freq/TabPaneFreq.js"; 18import {TabPaneCpuByThread} from "../sheet/cpu/TabPaneCpuByThread.js"; 19import {SelectionParam} from "../../../bean/BoxSelection.js"; 20import {TabPaneCpuByProcess} from "../sheet/cpu/TabPaneCpuByProcess.js"; 21import {TabPaneCpuUsage} from "../sheet/cpu/TabPaneCpuUsage.js"; 22import {TabPaneSPT} from "../sheet/cpu/TabPaneSPT.js"; 23import {TabPaneContextSwitch} from "../sheet/cpu/TabPaneContextSwitch.js"; 24import {TabPanePTS} from "../sheet/cpu/TabPanePTS.js"; 25import {TabPaneThreadSwitch} from "../sheet/cpu/TabPaneThreadSwitch.js"; 26import {TabPaneSlices} from "../sheet/process/TabPaneSlices.js"; 27import {TabPaneCounter} from "../sheet/process/TabPaneCounter.js"; 28import {TabPaneFps} from "../sheet/fps/TabPaneFps.js"; 29import {TabPaneFlag} from "../timer-shaft/TabPaneFlag.js"; 30import {TabPaneBoxChild} from "../sheet/cpu/TabPaneBoxChild.js"; 31import {TabPaneNMStatstics} from "../sheet/native-memory/TabPaneNMStatstics.js"; 32import {TabPaneNMCallInfo} from "../sheet/native-memory/TabPaneNMCallInfo.js"; 33import {TabPaneNMemory} from "../sheet/native-memory/TabPaneNMemory.js"; 34import {TabPaneNMSampleList} from "../sheet/native-memory/TabPaneNMSampleList.js"; 35import {TabpanePerfProfile} from "../sheet/hiperf/TabPerfProfile.js"; 36import {TabPanePerfSample} from "../sheet/hiperf/TabPerfSampleList.js"; 37import {TabPaneLiveProcesses} from "../sheet/ability/TabPaneLiveProcesses.js"; 38import {TabPaneHistoryProcesses} from "../sheet/ability/TabPaneHistoryProcesses.js"; 39import {TabPaneCpuAbility} from "../sheet/ability/TabPaneCpuAbility.js"; 40import {TabPaneMemoryAbility} from "../sheet/ability/TabPaneMemoryAbility.js"; 41import {TabPaneDiskAbility} from "../sheet/ability/TabPaneDiskAbility.js"; 42import {TabPaneNetworkAbility} from "../sheet/ability/TabPaneNetworkAbility.js"; 43import {TabPaneFileStatistics} from "../sheet/file-system/TabPaneFilesystemStatistics.js"; 44import {TabpaneFilesystemCalltree} from "../sheet/file-system/TabPaneFileSystemCalltree.js"; 45import {TabPaneFileSystemEvents} from "../sheet/file-system/TabPaneFileSystemEvents.js"; 46import {TabPaneFileSystemDescHistory} from "../sheet/file-system/TabPaneFileSystemDescHistory.js"; 47import {TabPaneFileSystemDescTimeSlice} from "../sheet/file-system/TabPaneFileSystemDescTimeSlice.js"; 48import {TabPaneSdkSlice} from "../sheet/sdk/TabPaneSdkSlice.js"; 49import {TabPaneSdkCounter} from "../sheet/sdk/TabPaneSdkCounter.js"; 50import {TabPaneCounterSample} from "../sheet/cpu/TabPaneCounterSample.js"; 51import {TabPaneThreadStates} from "../sheet/process/TabPaneThreadStates.js"; 52import {TabPaneFrequencySample} from "../sheet/cpu/TabPaneFrequencySample.js"; 53import {TabPaneEnergyAnomaly} from "../sheet/energy/TabPaneEnergyAnomaly.js"; 54import {TabPaneSystemDetails} from "../sheet/energy/TabPaneSystemDetails.js"; 55import {TabPanePowerDetails} from "../sheet/energy/TabPanePowerDetails.js"; 56import {TabPanePowerBattery} from "../sheet/energy/TabPanePowerBattery.js"; 57import {TabPaneCpuStateClick} from "../sheet/cpu/TabPaneCpuStateClick.js"; 58import {TabPaneVirtualMemoryStatistics} from "../sheet/file-system/TabPaneVirtualMemoryStatistics.js"; 59import {TabPaneIOTierStatistics} from "../sheet/file-system/TabPaneIOTierStatistics.js"; 60import {TabPaneIOCallTree, TabPaneVMCallTree} from "../sheet/file-system/TabPaneIOCallTree.js"; 61import {TabPaneIoCompletionTimes} from "../sheet/file-system/TabPaneIoCompletionTimes.js"; 62import {TabPaneVirtualMemoryEvents} from "../sheet/file-system/TabPaneVMEvents.js"; 63import {TabPaneSmapsStatistics} from "../sheet/smaps/TabPaneSmapsStatistics.js"; 64import {TabPaneSmapsRecord} from "../sheet/smaps/TabPaneSmapsRecord.js"; 65import {TabPaneFreqLimit} from "../sheet/freq/TabPaneFreqLimit.js"; 66import {TabPaneCpuFreqLimits} from "../sheet/freq/TabPaneCpuFreqLimits.js"; 67 68export let tabConfig: any = { 69 "current-selection": { 70 title: "Current Selection", type: TabPaneCurrentSelection, 71 }, //cpu data click 72 "cpu-state-click":{ 73 title: "Cpu State", type: TabPaneCpuStateClick, 74 }, 75 "box-freq": { 76 title: "Frequency", type: TabPaneFreq, 77 },//freq data click 78 "box-freq-limit":{ 79 title: "Frequency Limits", type: TabPaneFreqLimit, 80 }, 81 "box-cpu-freq-limit":{ 82 title: "Cpu Frequency Limits", type: TabPaneCpuFreqLimits, 83 require: (param: SelectionParam) => param.cpuFreqLimitDatas.length > 0, 84 }, 85 "box-cpu-thread": { 86 title: "CPU by thread", type: TabPaneCpuByThread, 87 require: (param: SelectionParam) => param.cpus.length > 0, 88 }, //range select 89 "box-cpu-process": { 90 title: "CPU by process", type: TabPaneCpuByProcess, 91 require: (param: SelectionParam) => param.cpus.length > 0, 92 }, 93 "box-cpu-usage": { 94 title: "CPU Usage", type: TabPaneCpuUsage, 95 require: (param: SelectionParam) => param.cpus.length > 0, 96 }, 97 "box-spt": { 98 title: "States List", type: TabPaneSPT, 99 require: (param: SelectionParam) => param.cpus.length > 0, 100 }, 101 "box-cs": { 102 title: "Switches List", type: TabPaneContextSwitch, 103 require: (param: SelectionParam) => param.cpus.length > 0, 104 }, 105 "box-pts": { 106 title: "Thread States", type: TabPanePTS, 107 require: (param: SelectionParam) => param.cpus.length > 0, 108 }, 109 "box-ts": { 110 title: "Thread Switches", type: TabPaneThreadSwitch, 111 require: (param: SelectionParam) => param.cpus.length > 0, 112 },//end range select 113 "box-slices": { 114 title: "Slices", type: TabPaneSlices, 115 require: (param: SelectionParam) => param.funTids.length > 0 || param.funAsync.length > 0, 116 }, 117 "box-counters": { 118 title: "Counters", type: TabPaneCounter, 119 require: (param: SelectionParam) => (param.processTrackIds.length > 0 || param.virtualTrackIds.length > 0), 120 }, 121 "box-fps": { 122 title: "FPS", type: TabPaneFps, 123 require: (param: SelectionParam) => param.hasFps, 124 }, 125 "box-flag": { 126 title: "Current Selection", type: TabPaneFlag, 127 }, 128 "box-cpu-child": { 129 title: "", type: TabPaneBoxChild, 130 }, 131 "box-native-statstics": { 132 title: "Statistics", type: TabPaneNMStatstics, 133 require: (param: SelectionParam) => param.nativeMemory.length > 0, 134 }, 135 "box-native-callinfo": { 136 title: "Call Info", type: TabPaneNMCallInfo, 137 require: (param: SelectionParam) => param.nativeMemory.length > 0, 138 }, 139 "box-native-memory": { 140 title: "Native Memory", type: TabPaneNMemory, 141 require: (param: SelectionParam) => param.nativeMemory.length > 0, 142 }, 143 "box-native-sample": { 144 title: "Snapshot List", type: TabPaneNMSampleList, 145 require: (param: SelectionParam) => param.nativeMemory.length > 0, 146 }, 147 "box-perf-profile": { 148 title: "Perf Profile", type: TabpanePerfProfile, 149 require: (param: SelectionParam) => param.perfSampleIds.length > 0, 150 }, 151 "box-perf-sample": { 152 title: "Sample List", type: TabPanePerfSample, 153 require: (param: SelectionParam) => param.perfSampleIds.length > 0, 154 }, 155 "box-live-processes-child": { 156 title: "Live Processes", type: TabPaneLiveProcesses, 157 require: (param: SelectionParam) => param.cpuAbilityIds.length > 0 || param.memoryAbilityIds.length > 0 && param.diskAbilityIds.length > 0 || param.networkAbilityIds.length > 0, 158 }, 159 "box-history-processes-child": { 160 title: "Processes History", type: TabPaneHistoryProcesses, 161 require: (param: SelectionParam) => param.cpuAbilityIds.length > 0 || param.memoryAbilityIds.length > 0 || param.diskAbilityIds.length > 0 || param.networkAbilityIds.length > 0, 162 }, 163 "box-system-cpu-child": { 164 title: "System CPU Summary", type: TabPaneCpuAbility, 165 require: (param: SelectionParam) => param.cpuAbilityIds.length > 0, 166 }, 167 "box-system-memory-child": { 168 title: "System Memory Summary", type: TabPaneMemoryAbility, 169 require: (param: SelectionParam) => param.memoryAbilityIds.length > 0, 170 }, 171 "box-system-diskIo-child": { 172 title: "System Disk Summary", type: TabPaneDiskAbility, 173 require: (param: SelectionParam) => param.diskAbilityIds.length > 0, 174 }, 175 "box-system-network-child": { 176 title: "System Network Summary", type: TabPaneNetworkAbility, 177 require: (param: SelectionParam) => param.networkAbilityIds.length > 0, 178 }, 179 "box-file-system-statistics": { 180 title: "Filesystem statistics", type: TabPaneFileStatistics, 181 require: (param: SelectionParam) => param.fileSystemType.length > 0, 182 }, 183 "box-file-system-calltree": { 184 title: "Filesystem Calltree", type: TabpaneFilesystemCalltree, 185 require: (param: SelectionParam) => param.fileSystemType.length > 0, 186 }, 187 "box-file-system-event": { 188 title: "Filesystem Events", type: TabPaneFileSystemEvents, 189 require: (param: SelectionParam) => param.fileSystemType.length > 0, 190 }, 191 "box-file-system-desc-history": { 192 title: "File Descriptor History", type: TabPaneFileSystemDescHistory, 193 require: (param: SelectionParam) => param.fileSystemType.length > 0, 194 }, 195 "box-file-system-desc-time-slice": { 196 title: "File Descriptor Time Slice", type: TabPaneFileSystemDescTimeSlice, 197 require: (param: SelectionParam) => param.fileSystemType.length > 0, 198 }, 199 "box-sdk-slice-child": { 200 title: "Sdk Slice", type: TabPaneSdkSlice, 201 require: (param: SelectionParam) => param.sdkSliceIds.length > 0, 202 }, 203 "box-system-counter-child": { 204 title: "SDK Counter", type: TabPaneSdkCounter, 205 require: (param: SelectionParam) => param.sdkCounterIds.length > 0, 206 }, 207 "box-counter-sample": { 208 title: "Cpu State", type: TabPaneCounterSample, 209 require: (param: SelectionParam) => param.cpuStateFilterIds.length > 0, 210 }, 211 "box-thread-states": { 212 title: "Thread States", type: TabPaneThreadStates, 213 require: (param: SelectionParam) => param.threadIds.length > 0, 214 }, 215 "box-frequency-sample": { 216 title: "Cpu Frequency", type: TabPaneFrequencySample, 217 require: (param: SelectionParam) => param.cpuFreqFilterIds.length > 0, 218 }, 219 "box-anomaly-details": { 220 title: "Anomaly details", type: TabPaneEnergyAnomaly, 221 require: (param: SelectionParam) => param.anomalyEnergy.length > 0, 222 }, 223 "box-system-details": { 224 title: "System Details", type: TabPaneSystemDetails, 225 require: (param: SelectionParam) => param.systemEnergy.length > 0, 226 }, 227 "box-power-battery": { 228 title: "Power Battery", type: TabPanePowerBattery, 229 require: (param: SelectionParam) => param.powerEnergy.length > 0, 230 }, 231 "box-power-details": { 232 title: "Power Details", type: TabPanePowerDetails, 233 require: (param: SelectionParam) => param.powerEnergy.length > 0, 234 }, 235 "box-virtual-memory-statistics": { 236 title: "Virtual Memory Statistics", type: TabPaneVirtualMemoryStatistics, 237 require: (param: SelectionParam) => param.fileSysVirtualMemory, 238 }, 239 "box-io-tier-statistics": { 240 title: "Disk I/O Tier Statistics", type: TabPaneIOTierStatistics, 241 require: (param: SelectionParam) => param.diskIOLatency, 242 }, 243 "box-io-calltree": { 244 title: "Disk I/O Latency Calltree", type: TabPaneIOCallTree, 245 require: (param: SelectionParam) => param.diskIOLatency, 246 }, 247 "box-io-events": { 248 title: "Trace Completion Times", type: TabPaneIoCompletionTimes, 249 require: (param: SelectionParam) => param.diskIOLatency, 250 }, 251 "box-vm-calltree": { 252 title: "Virtual Memory CallTree", type: TabPaneVMCallTree, 253 require: (param: SelectionParam) => param.fileSysVirtualMemory, 254 }, 255 "box-vm-events": { 256 title: "Virtual Memory Events", type: TabPaneVirtualMemoryEvents, 257 require: (param: SelectionParam) => param.fileSysVirtualMemory, 258 }, 259 "box-smaps-statistics": { 260 title: "VM Tracker Statistics", type: TabPaneSmapsStatistics, 261 require: (param: SelectionParam) => param.smapsType.length > 0, 262 }, 263 "box-smaps-record": { 264 title: "VM Tracker Record List", type: TabPaneSmapsRecord, 265 require: (param: SelectionParam) => param.smapsType.length > 0, 266 }, 267}