1fb726d48Sopenharmony_ci/* 2fb726d48Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd. 3fb726d48Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4fb726d48Sopenharmony_ci * you may not use this file except in compliance with the License. 5fb726d48Sopenharmony_ci * You may obtain a copy of the License at 6fb726d48Sopenharmony_ci * 7fb726d48Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8fb726d48Sopenharmony_ci * 9fb726d48Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10fb726d48Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11fb726d48Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12fb726d48Sopenharmony_ci * See the License for the specific language governing permissions and 13fb726d48Sopenharmony_ci * limitations under the License. 14fb726d48Sopenharmony_ci */ 15fb726d48Sopenharmony_ci 16fb726d48Sopenharmony_ciimport { FuncStruct } from '../database/ui-worker/ProcedureWorkerFunc'; 17fb726d48Sopenharmony_ciimport { FrameDynamicStruct } from '../database/ui-worker/ProcedureWorkerFrameDynamic'; 18fb726d48Sopenharmony_ciimport { FrameAnimationStruct } from '../database/ui-worker/ProcedureWorkerFrameAnimation'; 19fb726d48Sopenharmony_ciimport { FrameSpacingStruct } from '../database/ui-worker/ProcedureWorkerFrameSpacing'; 20fb726d48Sopenharmony_ciimport { JsCpuProfilerChartFrame } from './JsStruct'; 21fb726d48Sopenharmony_ciimport { LogStruct } from '../database/ui-worker/ProcedureWorkerLog'; 22fb726d48Sopenharmony_ciimport { HiSysEventStruct } from '../database/ui-worker/ProcedureWorkerHiSysEvent'; 23fb726d48Sopenharmony_ciimport { RangeSelectStruct, TraceRow } from '../component/trace/base/TraceRow'; 24fb726d48Sopenharmony_ciimport { info } from '../../log/Log'; 25fb726d48Sopenharmony_ciimport { SpSystemTrace } from '../component/SpSystemTrace'; 26fb726d48Sopenharmony_ciimport { intersectData, isExistPidInArray, setSelectState } from '../component/Utils'; 27fb726d48Sopenharmony_ciimport { TabPaneTaskFrames } from '../component/trace/sheet/task/TabPaneTaskFrames'; 28fb726d48Sopenharmony_ciimport { JanksStruct } from './JanksStruct'; 29fb726d48Sopenharmony_ciimport { HeapDataInterface } from '../../js-heap/HeapDataInterface'; 30fb726d48Sopenharmony_ciimport { LitTabs } from '../../base-ui/tabs/lit-tabs'; 31fb726d48Sopenharmony_ciimport { TabPaneSummary } from '../component/trace/sheet/ark-ts/TabPaneSummary'; 32fb726d48Sopenharmony_ciimport { JsCpuProfilerStruct } from '../database/ui-worker/ProcedureWorkerCpuProfiler'; 33fb726d48Sopenharmony_ciimport { SampleStruct } from '../database/ui-worker/ProcedureWorkerBpftrace'; 34fb726d48Sopenharmony_ciimport { GpuCounterStruct } from '../database/ui-worker/ProcedureWorkerGpuCounter'; 35fb726d48Sopenharmony_ciimport { Utils } from '../component/trace/base/Utils'; 36fb726d48Sopenharmony_ci 37fb726d48Sopenharmony_ciexport class SelectionParam { 38fb726d48Sopenharmony_ci traceId: string | undefined | null; 39fb726d48Sopenharmony_ci recordStartNs: number = 0; 40fb726d48Sopenharmony_ci leftNs: number = 0; 41fb726d48Sopenharmony_ci rightNs: number = 0; 42fb726d48Sopenharmony_ci hasFps: boolean = false; 43fb726d48Sopenharmony_ci statisticsSelectData: unknown = undefined; 44fb726d48Sopenharmony_ci fileSystemVMData: unknown = undefined; 45fb726d48Sopenharmony_ci fileSystemIoData: unknown = undefined; 46fb726d48Sopenharmony_ci fileSystemFsData: unknown = undefined; 47fb726d48Sopenharmony_ci perfAll: boolean = false; 48fb726d48Sopenharmony_ci fileSysVirtualMemory: boolean = false; 49fb726d48Sopenharmony_ci diskIOLatency: boolean = false; 50fb726d48Sopenharmony_ci fsCount: number = 0; 51fb726d48Sopenharmony_ci vmCount: number = 0; 52fb726d48Sopenharmony_ci isCurrentPane: boolean = false; 53fb726d48Sopenharmony_ci startup: boolean = false; 54fb726d48Sopenharmony_ci staticInit: boolean = false; 55fb726d48Sopenharmony_ci isRowClick: boolean = false; 56fb726d48Sopenharmony_ci eventTypeId: string = ''; 57fb726d48Sopenharmony_ci cpus: Array<number> = []; 58fb726d48Sopenharmony_ci cpuStateRowsId: Array<object> = []; 59fb726d48Sopenharmony_ci //新增框选cpu freq row名 60fb726d48Sopenharmony_ci cpuFreqFilterNames: Array<string> = []; 61fb726d48Sopenharmony_ci cpuStateFilterIds: Array<number> = []; 62fb726d48Sopenharmony_ci cpuFreqFilterIds: Array<number> = []; 63fb726d48Sopenharmony_ci threadIds: Array<number> = []; 64fb726d48Sopenharmony_ci processIds: Array<number> = []; 65fb726d48Sopenharmony_ci processTrackIds: Array<number> = []; 66fb726d48Sopenharmony_ci virtualTrackIds: Array<number> = []; 67fb726d48Sopenharmony_ci cpuFreqLimit: Array<unknown> = []; 68fb726d48Sopenharmony_ci clockMapData: Map<string, ((arg: unknown) => Promise<Array<unknown>> | undefined) | undefined> = new Map< 69fb726d48Sopenharmony_ci string, 70fb726d48Sopenharmony_ci ((arg: unknown) => Promise<Array<unknown>> | undefined) | undefined 71fb726d48Sopenharmony_ci >(); 72fb726d48Sopenharmony_ci dmaFenceNameData: Array<String> = [];//新增框选dma_fence数据 73fb726d48Sopenharmony_ci xpowerMapData: Map<string, ((arg: unknown) => Promise<Array<unknown>> | undefined) | undefined> = new Map< 74fb726d48Sopenharmony_ci string, 75fb726d48Sopenharmony_ci ((arg: unknown) => Promise<Array<unknown>> | undefined) | undefined 76fb726d48Sopenharmony_ci>(); 77fb726d48Sopenharmony_ci hangMapData: Map<string, ((arg: unknown) => Promise<Array<unknown>> | undefined) | undefined> = new Map(); 78fb726d48Sopenharmony_ci irqCallIds: Array<number> = []; 79fb726d48Sopenharmony_ci softIrqCallIds: Array<number> = []; 80fb726d48Sopenharmony_ci funTids: Array<number> = []; 81fb726d48Sopenharmony_ci funAsync: Array<{ name: string; pid: number, tid: number | undefined }> = []; 82fb726d48Sopenharmony_ci funCatAsync: Array<{ pid: number; threadName: string }> = []; 83fb726d48Sopenharmony_ci nativeMemory: Array<String> = []; 84fb726d48Sopenharmony_ci nativeMemoryStatistic: Array<String> = []; 85fb726d48Sopenharmony_ci nativeMemoryAllProcess: Array<{ pid: number; ipid: number }> = []; 86fb726d48Sopenharmony_ci nativeMemoryCurrentIPid: number = -1; 87fb726d48Sopenharmony_ci cpuAbilityIds: Array<string> = []; 88fb726d48Sopenharmony_ci memoryAbilityIds: Array<string> = []; 89fb726d48Sopenharmony_ci diskAbilityIds: Array<string> = []; 90fb726d48Sopenharmony_ci networkAbilityIds: Array<string> = []; 91fb726d48Sopenharmony_ci perfSampleIds: Array<number> = []; 92fb726d48Sopenharmony_ci perfEventTypeId?: number; 93fb726d48Sopenharmony_ci perfCpus: Array<number> = []; 94fb726d48Sopenharmony_ci perfProcess: Array<number> = []; 95fb726d48Sopenharmony_ci perfThread: Array<number> = []; 96fb726d48Sopenharmony_ci fileSystemType: Array<number> = []; 97fb726d48Sopenharmony_ci sdkCounterIds: Array<string> = []; 98fb726d48Sopenharmony_ci sdkSliceIds: Array<string> = []; 99fb726d48Sopenharmony_ci diskIOipids: Array<number> = []; 100fb726d48Sopenharmony_ci diskIOReadIds: Array<number> = []; 101fb726d48Sopenharmony_ci diskIOWriteIds: Array<number> = []; 102fb726d48Sopenharmony_ci systemEnergy: Array<string> = []; 103fb726d48Sopenharmony_ci powerEnergy: Array<string> = []; 104fb726d48Sopenharmony_ci anomalyEnergy: Array<string> = []; 105fb726d48Sopenharmony_ci smapsType: Array<string> = []; 106fb726d48Sopenharmony_ci vmtrackershm: Array<string> = []; 107fb726d48Sopenharmony_ci promiseList: Array<Promise<unknown>> = []; 108fb726d48Sopenharmony_ci jankFramesData: Array<unknown> = []; 109fb726d48Sopenharmony_ci jsMemory: Array<unknown> = []; 110fb726d48Sopenharmony_ci taskFramesData: Array<FuncStruct> = []; 111fb726d48Sopenharmony_ci frameDynamic: Array<FrameDynamicStruct> = []; 112fb726d48Sopenharmony_ci frameAnimation: Array<FrameAnimationStruct> = []; 113fb726d48Sopenharmony_ci frameSpacing: Array<FrameSpacingStruct> = []; 114fb726d48Sopenharmony_ci jsCpuProfilerData: Array<JsCpuProfilerChartFrame> = []; 115fb726d48Sopenharmony_ci gpu: { 116fb726d48Sopenharmony_ci gl: boolean; 117fb726d48Sopenharmony_ci graph: boolean; 118fb726d48Sopenharmony_ci gpuTotal: boolean; 119fb726d48Sopenharmony_ci gpuWindow: boolean; 120fb726d48Sopenharmony_ci } = { 121fb726d48Sopenharmony_ci gl: false, 122fb726d48Sopenharmony_ci graph: false, 123fb726d48Sopenharmony_ci gpuWindow: false, 124fb726d48Sopenharmony_ci gpuTotal: false, 125fb726d48Sopenharmony_ci }; 126fb726d48Sopenharmony_ci purgeableTotalAbility: Array<unknown> = []; 127fb726d48Sopenharmony_ci purgeableTotalVM: Array<unknown> = []; 128fb726d48Sopenharmony_ci purgeablePinAbility: Array<unknown> = []; 129fb726d48Sopenharmony_ci purgeablePinVM: Array<unknown> = []; 130fb726d48Sopenharmony_ci purgeableTotalSelection: Array<unknown> = []; 131fb726d48Sopenharmony_ci purgeablePinSelection: Array<unknown> = []; 132fb726d48Sopenharmony_ci dmaAbilityData: Array<unknown> = []; 133fb726d48Sopenharmony_ci gpuMemoryAbilityData: Array<unknown> = []; 134fb726d48Sopenharmony_ci dmaVmTrackerData: Array<unknown> = []; 135fb726d48Sopenharmony_ci gpuMemoryTrackerData: Array<unknown> = []; 136fb726d48Sopenharmony_ci hiLogs: Array<string> = []; 137fb726d48Sopenharmony_ci sysAllEventsData: Array<HiSysEventStruct> = []; 138fb726d48Sopenharmony_ci sysAlllogsData: Array<LogStruct> = []; 139fb726d48Sopenharmony_ci hiSysEvents: Array<string> = []; 140fb726d48Sopenharmony_ci sampleData: Array<unknown> = []; 141fb726d48Sopenharmony_ci gpuCounter: Array<unknown> = []; 142fb726d48Sopenharmony_ci 143fb726d48Sopenharmony_ci // @ts-ignore 144fb726d48Sopenharmony_ci pushSampleData(it: TraceRow<unknown>): void { 145fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SAMPLE) { 146fb726d48Sopenharmony_ci let dataList: SampleStruct[] = JSON.parse(JSON.stringify(it.dataList)); 147fb726d48Sopenharmony_ci if (dataList.length > 0) { 148fb726d48Sopenharmony_ci dataList.forEach((SampleStruct) => { 149fb726d48Sopenharmony_ci SampleStruct.property = SampleStruct.property!.filter( 150fb726d48Sopenharmony_ci (i: unknown) => 151fb726d48Sopenharmony_ci // @ts-ignore 152fb726d48Sopenharmony_ci (i.begin! - i.startTs! ?? 0) >= TraceRow.rangeSelectObject!.startNS! && 153fb726d48Sopenharmony_ci // @ts-ignore 154fb726d48Sopenharmony_ci (i.end! - i.startTs! ?? 0) <= TraceRow.rangeSelectObject!.endNS! 155fb726d48Sopenharmony_ci ); 156fb726d48Sopenharmony_ci }); 157fb726d48Sopenharmony_ci if (dataList[0].property!.length !== 0) { 158fb726d48Sopenharmony_ci this.sampleData.push(...dataList); 159fb726d48Sopenharmony_ci } 160fb726d48Sopenharmony_ci } 161fb726d48Sopenharmony_ci } 162fb726d48Sopenharmony_ci } 163fb726d48Sopenharmony_ci 164fb726d48Sopenharmony_ci // @ts-ignore 165fb726d48Sopenharmony_ci pushCpus(it: TraceRow<unknown>): void { 166fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CPU) { 167fb726d48Sopenharmony_ci this.cpus.push(parseInt(it.rowId!)); 168fb726d48Sopenharmony_ci info('load CPU traceRow id is : ', it.rowId); 169fb726d48Sopenharmony_ci } 170fb726d48Sopenharmony_ci } 171fb726d48Sopenharmony_ci 172fb726d48Sopenharmony_ci // @ts-ignore 173fb726d48Sopenharmony_ci pushCpuStateFilterIds(it: TraceRow<unknown>): void { 174fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CPU_STATE_ALL) { 175fb726d48Sopenharmony_ci it.childrenList.forEach((child) => { 176fb726d48Sopenharmony_ci child.rangeSelect = true; 177fb726d48Sopenharmony_ci child.checkType = '2'; 178fb726d48Sopenharmony_ci this.pushCpuStateFilterIds(child); 179fb726d48Sopenharmony_ci }); 180fb726d48Sopenharmony_ci } 181fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CPU_STATE) { 182fb726d48Sopenharmony_ci let filterId = parseInt(it.rowId!); 183fb726d48Sopenharmony_ci if (this.cpuStateFilterIds.indexOf(filterId) === -1) { 184fb726d48Sopenharmony_ci this.cpuStateFilterIds.push(filterId); 185fb726d48Sopenharmony_ci } 186fb726d48Sopenharmony_ci } 187fb726d48Sopenharmony_ci } 188fb726d48Sopenharmony_ci 189fb726d48Sopenharmony_ci // @ts-ignore 190fb726d48Sopenharmony_ci pushCpuFreqFilter(it: TraceRow<unknown>): void { 191fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CPU_FREQ_ALL) { 192fb726d48Sopenharmony_ci it.childrenList.forEach((child) => { 193fb726d48Sopenharmony_ci child.rangeSelect = true; 194fb726d48Sopenharmony_ci child.checkType = '2'; 195fb726d48Sopenharmony_ci this.pushCpuFreqFilter(child); 196fb726d48Sopenharmony_ci }); 197fb726d48Sopenharmony_ci } 198fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CPU_FREQ) { 199fb726d48Sopenharmony_ci let filterId = parseInt(it.rowId!); 200fb726d48Sopenharmony_ci let filterName = it.name!; 201fb726d48Sopenharmony_ci if (this.cpuFreqFilterIds.indexOf(filterId) === -1) { 202fb726d48Sopenharmony_ci this.cpuFreqFilterIds.push(filterId); 203fb726d48Sopenharmony_ci } 204fb726d48Sopenharmony_ci if (this.cpuFreqFilterNames.indexOf(filterName) === -1) { 205fb726d48Sopenharmony_ci this.cpuFreqFilterNames.push(filterName); 206fb726d48Sopenharmony_ci } 207fb726d48Sopenharmony_ci } 208fb726d48Sopenharmony_ci } 209fb726d48Sopenharmony_ci 210fb726d48Sopenharmony_ci // @ts-ignore 211fb726d48Sopenharmony_ci pushCpuFreqLimit(it: TraceRow<unknown>): void { 212fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CPU_FREQ_LIMITALL) { 213fb726d48Sopenharmony_ci it.childrenList.forEach((child) => { 214fb726d48Sopenharmony_ci child.rangeSelect = true; 215fb726d48Sopenharmony_ci child.checkType = '2'; 216fb726d48Sopenharmony_ci this.pushCpuFreqLimit(child); 217fb726d48Sopenharmony_ci }); 218fb726d48Sopenharmony_ci } 219fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CPU_FREQ_LIMIT) { 220fb726d48Sopenharmony_ci // @ts-ignore 221fb726d48Sopenharmony_ci if (!this.cpuFreqLimit.includes((item: unknown) => item.cpu === it.getAttribute('cpu'))) { 222fb726d48Sopenharmony_ci this.cpuFreqLimit.push({ 223fb726d48Sopenharmony_ci maxFilterId: it.getAttribute('maxFilterId'), 224fb726d48Sopenharmony_ci minFilterId: it.getAttribute('minFilterId'), 225fb726d48Sopenharmony_ci cpu: it.getAttribute('cpu'), 226fb726d48Sopenharmony_ci }); 227fb726d48Sopenharmony_ci } 228fb726d48Sopenharmony_ci } 229fb726d48Sopenharmony_ci } 230fb726d48Sopenharmony_ci 231fb726d48Sopenharmony_ci // @ts-ignore 232fb726d48Sopenharmony_ci pushProcess(it: TraceRow<unknown>, sp: SpSystemTrace): void { 233fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PROCESS || it.rowType === TraceRow.ROW_TYPE_IMPORT) { 234fb726d48Sopenharmony_ci sp.pushPidToSelection(this, it.rowId!, it.summaryProtoPid); 235fb726d48Sopenharmony_ci sp.pushPidToSelection(this, it.rowId!); 236fb726d48Sopenharmony_ci if (it.getAttribute('hasStartup') === 'true') { 237fb726d48Sopenharmony_ci this.startup = true; 238fb726d48Sopenharmony_ci } 239fb726d48Sopenharmony_ci if (it.getAttribute('hasStaticInit') === 'true') { 240fb726d48Sopenharmony_ci this.staticInit = true; 241fb726d48Sopenharmony_ci } 242fb726d48Sopenharmony_ci // @ts-ignore 243fb726d48Sopenharmony_ci let processChildRows: Array<TraceRow<unknown>> = [ 244fb726d48Sopenharmony_ci // @ts-ignore 245fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${it.rowId}']`), 246fb726d48Sopenharmony_ci ]; 247fb726d48Sopenharmony_ci if (!it.expansion) { 248fb726d48Sopenharmony_ci processChildRows = [...it.childrenList]; 249fb726d48Sopenharmony_ci } 250fb726d48Sopenharmony_ci processChildRows.forEach((th) => { 251fb726d48Sopenharmony_ci th.rangeSelect = true; 252fb726d48Sopenharmony_ci th.checkType = '2'; 253fb726d48Sopenharmony_ci if (th.rowType === TraceRow.ROW_TYPE_THREAD) { 254fb726d48Sopenharmony_ci this.threadIds.push(parseInt(th.rowId!)); 255fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_FUNC) { 256fb726d48Sopenharmony_ci if (th.asyncFuncName) { 257fb726d48Sopenharmony_ci if (typeof th.asyncFuncName === 'string') { 258fb726d48Sopenharmony_ci this.funAsync.push({ 259fb726d48Sopenharmony_ci name: th.asyncFuncName, 260fb726d48Sopenharmony_ci pid: th.asyncFuncNamePID || 0, 261fb726d48Sopenharmony_ci tid: th.asyncFuncStartTID 262fb726d48Sopenharmony_ci }); 263fb726d48Sopenharmony_ci } else { 264fb726d48Sopenharmony_ci for (let i = 0; i < th.asyncFuncName.length; i++) { 265fb726d48Sopenharmony_ci const el = th.asyncFuncName[i]; 266fb726d48Sopenharmony_ci this.funAsync.push({ 267fb726d48Sopenharmony_ci name: el, 268fb726d48Sopenharmony_ci pid: th.asyncFuncNamePID || 0, 269fb726d48Sopenharmony_ci tid: th.asyncFuncStartTID 270fb726d48Sopenharmony_ci }); 271fb726d48Sopenharmony_ci } 272fb726d48Sopenharmony_ci } 273fb726d48Sopenharmony_ci } else if (th.asyncFuncThreadName) { 274fb726d48Sopenharmony_ci if (typeof th.asyncFuncThreadName === 'string') { 275fb726d48Sopenharmony_ci this.funCatAsync.push({ 276fb726d48Sopenharmony_ci pid: th.asyncFuncNamePID || 0, 277fb726d48Sopenharmony_ci threadName: th.asyncFuncThreadName, 278fb726d48Sopenharmony_ci }); 279fb726d48Sopenharmony_ci } 280fb726d48Sopenharmony_ci } else { 281fb726d48Sopenharmony_ci this.funTids.push(parseInt(th.rowId!)); 282fb726d48Sopenharmony_ci } 283fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_MEM) { 284fb726d48Sopenharmony_ci this.processTrackIds.push(parseInt(th.rowId!)); 285fb726d48Sopenharmony_ci } 286fb726d48Sopenharmony_ci }); 287fb726d48Sopenharmony_ci info('load process traceRow id is : ', it.rowId); 288fb726d48Sopenharmony_ci } 289fb726d48Sopenharmony_ci } 290fb726d48Sopenharmony_ci 291fb726d48Sopenharmony_ci // @ts-ignore 292fb726d48Sopenharmony_ci pushNativeMemory(it: TraceRow<unknown>, sp: SpSystemTrace): void { 293fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_NATIVE_MEMORY) { 294fb726d48Sopenharmony_ci // @ts-ignore 295fb726d48Sopenharmony_ci let memoryRows: Array<TraceRow<unknown>> = [ 296fb726d48Sopenharmony_ci // @ts-ignore 297fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${it.rowId}']`), 298fb726d48Sopenharmony_ci ]; 299fb726d48Sopenharmony_ci if (!it.expansion) { 300fb726d48Sopenharmony_ci memoryRows = [...it.childrenList]; 301fb726d48Sopenharmony_ci } 302fb726d48Sopenharmony_ci const rowKey = it.rowId!.split(' '); 303fb726d48Sopenharmony_ci const process = { 304fb726d48Sopenharmony_ci ipid: Number(rowKey[rowKey.length - 1]), 305fb726d48Sopenharmony_ci pid: Number(rowKey[rowKey.length - 2]), 306fb726d48Sopenharmony_ci }; 307fb726d48Sopenharmony_ci if (!isExistPidInArray(this.nativeMemoryAllProcess, process.pid)) { 308fb726d48Sopenharmony_ci this.nativeMemoryAllProcess.push(process); 309fb726d48Sopenharmony_ci } 310fb726d48Sopenharmony_ci if (this.nativeMemoryCurrentIPid === -1) { 311fb726d48Sopenharmony_ci this.nativeMemoryCurrentIPid = process.ipid; 312fb726d48Sopenharmony_ci } 313fb726d48Sopenharmony_ci memoryRows.forEach((th) => { 314fb726d48Sopenharmony_ci th.rangeSelect = true; 315fb726d48Sopenharmony_ci th.checkType = '2'; 316fb726d48Sopenharmony_ci if (th.getAttribute('heap-type') === 'native_hook_statistic') { 317fb726d48Sopenharmony_ci this.nativeMemoryStatistic.push(th.rowId!); 318fb726d48Sopenharmony_ci } else { 319fb726d48Sopenharmony_ci this.nativeMemory.push(th.rowId!); 320fb726d48Sopenharmony_ci } 321fb726d48Sopenharmony_ci }); 322fb726d48Sopenharmony_ci info('load nativeMemory traceRow id is : ', it.rowId); 323fb726d48Sopenharmony_ci } 324fb726d48Sopenharmony_ci } 325fb726d48Sopenharmony_ci 326fb726d48Sopenharmony_ci // @ts-ignore 327fb726d48Sopenharmony_ci pushFunc(it: TraceRow<unknown>, sp: SpSystemTrace): void { 328fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_FUNC) { 329fb726d48Sopenharmony_ci TabPaneTaskFrames.TaskArray = []; 330fb726d48Sopenharmony_ci sp.pushPidToSelection(this, it.rowParentId!, it.protoPid); 331fb726d48Sopenharmony_ci if (it.asyncFuncName) { 332fb726d48Sopenharmony_ci if (typeof it.asyncFuncName === 'string') { 333fb726d48Sopenharmony_ci this.funAsync.push({ 334fb726d48Sopenharmony_ci name: it.asyncFuncName, 335fb726d48Sopenharmony_ci pid: it.asyncFuncNamePID || 0, 336fb726d48Sopenharmony_ci tid: it.asyncFuncStartTID 337fb726d48Sopenharmony_ci }); 338fb726d48Sopenharmony_ci } else { 339fb726d48Sopenharmony_ci //@ts-ignore 340fb726d48Sopenharmony_ci for (let i = 0; i < it.asyncFuncName.length; i++) { 341fb726d48Sopenharmony_ci const el = it.asyncFuncName[i]; 342fb726d48Sopenharmony_ci this.funAsync.push({ 343fb726d48Sopenharmony_ci name: el, 344fb726d48Sopenharmony_ci pid: it.asyncFuncNamePID || 0, 345fb726d48Sopenharmony_ci tid: it.asyncFuncStartTID 346fb726d48Sopenharmony_ci }); 347fb726d48Sopenharmony_ci } 348fb726d48Sopenharmony_ci } 349fb726d48Sopenharmony_ci } else if (it.asyncFuncThreadName) { 350fb726d48Sopenharmony_ci if (typeof it.asyncFuncThreadName === 'string') { 351fb726d48Sopenharmony_ci this.funCatAsync.push({ 352fb726d48Sopenharmony_ci pid: it.asyncFuncNamePID || 0, 353fb726d48Sopenharmony_ci threadName: it.asyncFuncThreadName 354fb726d48Sopenharmony_ci }); 355fb726d48Sopenharmony_ci } else { 356fb726d48Sopenharmony_ci for (let i = 0; i < it.asyncFuncThreadName.length; i++) { 357fb726d48Sopenharmony_ci const tn = it.asyncFuncThreadName[i]; 358fb726d48Sopenharmony_ci this.funCatAsync.push({ 359fb726d48Sopenharmony_ci pid: it.asyncFuncNamePID || 0, //@ts-ignore 360fb726d48Sopenharmony_ci threadName: tn 361fb726d48Sopenharmony_ci }); 362fb726d48Sopenharmony_ci } 363fb726d48Sopenharmony_ci } 364fb726d48Sopenharmony_ci } else { 365fb726d48Sopenharmony_ci this.funTids.push(parseInt(it.rowId!)); 366fb726d48Sopenharmony_ci } 367fb726d48Sopenharmony_ci 368fb726d48Sopenharmony_ci let isIntersect = (filterFunc: FuncStruct, rangeData: RangeSelectStruct): boolean => 369fb726d48Sopenharmony_ci Math.max(filterFunc.startTs! + filterFunc.dur!, rangeData!.endNS || 0) - 370fb726d48Sopenharmony_ci Math.min(filterFunc.startTs!, rangeData!.startNS || 0) < 371fb726d48Sopenharmony_ci filterFunc.dur! + (rangeData!.endNS || 0) - (rangeData!.startNS || 0) && 372fb726d48Sopenharmony_ci filterFunc.funName!.indexOf('H:Task ') >= 0; 373fb726d48Sopenharmony_ci // @ts-ignore 374fb726d48Sopenharmony_ci let taskData = it.dataListCache.filter((taskData: FuncStruct) => { 375fb726d48Sopenharmony_ci taskData!.tid = isNaN(Number(it.rowId!)) && typeof it.rowId! === 'string' ? 376fb726d48Sopenharmony_ci (function() { 377fb726d48Sopenharmony_ci const match = (it.rowId!).match(/-(\d+)/); 378fb726d48Sopenharmony_ci return match ? parseInt(match[1]) : undefined; 379fb726d48Sopenharmony_ci })() : 380fb726d48Sopenharmony_ci parseInt(it.rowId!); 381fb726d48Sopenharmony_ci return isIntersect(taskData, TraceRow.rangeSelectObject!); 382fb726d48Sopenharmony_ci }); 383fb726d48Sopenharmony_ci if (taskData.length > 0) { 384fb726d48Sopenharmony_ci // @ts-ignore 385fb726d48Sopenharmony_ci this.taskFramesData.push(...taskData); 386fb726d48Sopenharmony_ci } 387fb726d48Sopenharmony_ci info('load func traceRow id is : ', it.rowId); 388fb726d48Sopenharmony_ci } 389fb726d48Sopenharmony_ci } 390fb726d48Sopenharmony_ci 391fb726d48Sopenharmony_ci // @ts-ignore 392fb726d48Sopenharmony_ci pushHeap(it: TraceRow<unknown>, sp: SpSystemTrace): void { 393fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HEAP) { 394fb726d48Sopenharmony_ci const key = it.rowParentId!.split(' '); 395fb726d48Sopenharmony_ci const process = { 396fb726d48Sopenharmony_ci ipid: Number(key[key.length - 1]), 397fb726d48Sopenharmony_ci pid: Number(key[key.length - 2]), 398fb726d48Sopenharmony_ci }; 399fb726d48Sopenharmony_ci 400fb726d48Sopenharmony_ci if (!isExistPidInArray(this.nativeMemoryAllProcess, process.pid)) { 401fb726d48Sopenharmony_ci this.nativeMemoryAllProcess.push(process); 402fb726d48Sopenharmony_ci } 403fb726d48Sopenharmony_ci if (this.nativeMemoryCurrentIPid === -1) { 404fb726d48Sopenharmony_ci this.nativeMemoryCurrentIPid = process.ipid; 405fb726d48Sopenharmony_ci Utils.getInstance().setCurrentSelectIPid(this.nativeMemoryCurrentIPid); 406fb726d48Sopenharmony_ci } 407fb726d48Sopenharmony_ci if (this.nativeMemoryAllProcess) { 408fb726d48Sopenharmony_ci if (it.getAttribute('heap-type') === 'native_hook_statistic') { 409fb726d48Sopenharmony_ci this.nativeMemoryStatistic.push(it.rowId!); 410fb726d48Sopenharmony_ci } else { 411fb726d48Sopenharmony_ci this.nativeMemory.push(it.rowId!); 412fb726d48Sopenharmony_ci } 413fb726d48Sopenharmony_ci } 414fb726d48Sopenharmony_ci info('load nativeMemory traceRow id is : ', it.rowId); 415fb726d48Sopenharmony_ci } 416fb726d48Sopenharmony_ci } 417fb726d48Sopenharmony_ci 418fb726d48Sopenharmony_ci // @ts-ignore 419fb726d48Sopenharmony_ci pushMonitor(it: TraceRow<unknown>, sp: SpSystemTrace): void { 420fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_MONITOR) { 421fb726d48Sopenharmony_ci // @ts-ignore 422fb726d48Sopenharmony_ci let abilityChildRows: Array<TraceRow<unknown>> = [ 423fb726d48Sopenharmony_ci // @ts-ignore 424fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${it.rowId}']`), 425fb726d48Sopenharmony_ci ]; 426fb726d48Sopenharmony_ci if (!it.expansion) { 427fb726d48Sopenharmony_ci abilityChildRows = [...it.childrenList]; 428fb726d48Sopenharmony_ci } 429fb726d48Sopenharmony_ci abilityChildRows.forEach((th) => { 430fb726d48Sopenharmony_ci th.rangeSelect = true; 431fb726d48Sopenharmony_ci th.checkType = '2'; 432fb726d48Sopenharmony_ci if (th.rowType === TraceRow.ROW_TYPE_CPU_ABILITY) { 433fb726d48Sopenharmony_ci this.cpuAbilityIds.push(th.rowId!); 434fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_MEMORY_ABILITY) { 435fb726d48Sopenharmony_ci this.memoryAbilityIds.push(th.rowId!); 436fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_DISK_ABILITY) { 437fb726d48Sopenharmony_ci this.diskAbilityIds.push(th.rowId!); 438fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_NETWORK_ABILITY) { 439fb726d48Sopenharmony_ci this.networkAbilityIds.push(th.rowId!); 440fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_DMA_ABILITY) { 441fb726d48Sopenharmony_ci this.dmaAbilityData.push(...intersectData(th)!); 442fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_GPU_MEMORY_ABILITY) { 443fb726d48Sopenharmony_ci this.gpuMemoryAbilityData.push(...intersectData(th)!); 444fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_PURGEABLE_TOTAL_ABILITY) { 445fb726d48Sopenharmony_ci this.purgeableTotalAbility.push(...intersectData(th)); 446fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_PURGEABLE_PIN_ABILITY) { 447fb726d48Sopenharmony_ci this.purgeablePinAbility.push(...intersectData(th)); 448fb726d48Sopenharmony_ci } 449fb726d48Sopenharmony_ci }); 450fb726d48Sopenharmony_ci } 451fb726d48Sopenharmony_ci } 452fb726d48Sopenharmony_ci 453fb726d48Sopenharmony_ci // @ts-ignore 454fb726d48Sopenharmony_ci pushHiperf(it: TraceRow<unknown>, sp: SpSystemTrace): void { 455fb726d48Sopenharmony_ci if (it.rowType?.startsWith('hiperf')) { 456fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HIPERF_EVENT || it.rowType === TraceRow.ROW_TYPE_HIPERF_REPORT) { 457fb726d48Sopenharmony_ci return; 458fb726d48Sopenharmony_ci } 459fb726d48Sopenharmony_ci this.perfEventTypeId = it.drawType === -2 ? undefined : it.drawType; 460fb726d48Sopenharmony_ci this.perfSampleIds.push(1); 461fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PERF_CALLCHART) { 462fb726d48Sopenharmony_ci let setting = it.getRowSettingKeys(); 463fb726d48Sopenharmony_ci if (setting && setting.length > 0) { 464fb726d48Sopenharmony_ci //type 0:cpu,1:process,2:thread 465fb726d48Sopenharmony_ci let key: string = setting[0]; 466fb726d48Sopenharmony_ci let id = Number(key.split('-')[0]); 467fb726d48Sopenharmony_ci if (key.includes('p')) { 468fb726d48Sopenharmony_ci this.perfProcess.push(id); 469fb726d48Sopenharmony_ci } else if (key.includes('t')) { 470fb726d48Sopenharmony_ci this.perfThread.push(id); 471fb726d48Sopenharmony_ci } else { 472fb726d48Sopenharmony_ci this.perfCpus.push(id); 473fb726d48Sopenharmony_ci } 474fb726d48Sopenharmony_ci } 475fb726d48Sopenharmony_ci } 476fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HIPERF_PROCESS) { 477fb726d48Sopenharmony_ci // @ts-ignore 478fb726d48Sopenharmony_ci let hiperfProcessRows: Array<TraceRow<unknown>> = [ 479fb726d48Sopenharmony_ci // @ts-ignore 480fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${it.rowId}']`), 481fb726d48Sopenharmony_ci ]; 482fb726d48Sopenharmony_ci if (!it.expansion) { 483fb726d48Sopenharmony_ci hiperfProcessRows = [...it.childrenList]; 484fb726d48Sopenharmony_ci } 485fb726d48Sopenharmony_ci hiperfProcessRows.forEach((th) => { 486fb726d48Sopenharmony_ci th.rangeSelect = true; 487fb726d48Sopenharmony_ci th.checkType = '2'; 488fb726d48Sopenharmony_ci }); 489fb726d48Sopenharmony_ci } 490fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HIPERF || it.rowId === 'HiPerf-cpu-merge') { 491fb726d48Sopenharmony_ci this.perfAll = true; 492fb726d48Sopenharmony_ci } 493fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HIPERF_CPU) { 494fb726d48Sopenharmony_ci this.perfCpus.push(it.index); 495fb726d48Sopenharmony_ci } 496fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HIPERF_PROCESS) { 497fb726d48Sopenharmony_ci this.perfProcess.push(parseInt(it.rowId!.split('-')[0])); 498fb726d48Sopenharmony_ci } 499fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HIPERF_THREAD) { 500fb726d48Sopenharmony_ci this.perfThread.push(parseInt(it.rowId!.split('-')[0])); 501fb726d48Sopenharmony_ci } 502fb726d48Sopenharmony_ci } 503fb726d48Sopenharmony_ci } 504fb726d48Sopenharmony_ci 505fb726d48Sopenharmony_ci // @ts-ignore 506fb726d48Sopenharmony_ci pushFileSystem(it: TraceRow<unknown>, sp: SpSystemTrace): void { 507fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_FILE_SYSTEM_GROUP) { 508fb726d48Sopenharmony_ci it.childrenList.forEach((child) => { 509fb726d48Sopenharmony_ci child.rangeSelect = true; 510fb726d48Sopenharmony_ci child.checkType = '2'; 511fb726d48Sopenharmony_ci this.pushFileSystem(child, sp); 512fb726d48Sopenharmony_ci }); 513fb726d48Sopenharmony_ci } 514fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_FILE_SYSTEM) { 515fb726d48Sopenharmony_ci if (it.rowId === 'FileSystemLogicalWrite') { 516fb726d48Sopenharmony_ci if (this.fileSystemType.length === 0) { 517fb726d48Sopenharmony_ci this.fileSystemType = [0, 1, 3]; 518fb726d48Sopenharmony_ci } else { 519fb726d48Sopenharmony_ci if (this.fileSystemType.indexOf(3) === -1) { 520fb726d48Sopenharmony_ci this.fileSystemType.push(3); 521fb726d48Sopenharmony_ci } 522fb726d48Sopenharmony_ci } 523fb726d48Sopenharmony_ci } else if (it.rowId === 'FileSystemLogicalRead') { 524fb726d48Sopenharmony_ci if (this.fileSystemType.length === 0) { 525fb726d48Sopenharmony_ci this.fileSystemType = [0, 1, 2]; 526fb726d48Sopenharmony_ci } else { 527fb726d48Sopenharmony_ci if (this.fileSystemType.indexOf(2) === -1) { 528fb726d48Sopenharmony_ci this.fileSystemType.push(2); 529fb726d48Sopenharmony_ci } 530fb726d48Sopenharmony_ci } 531fb726d48Sopenharmony_ci } else if (it.rowId === 'FileSystemVirtualMemory') { 532fb726d48Sopenharmony_ci this.fileSysVirtualMemory = true; 533fb726d48Sopenharmony_ci } else if (it.rowId === 'FileSystemDiskIOLatency') { 534fb726d48Sopenharmony_ci this.diskIOLatency = true; 535fb726d48Sopenharmony_ci } else { 536fb726d48Sopenharmony_ci if (!this.diskIOLatency) { 537fb726d48Sopenharmony_ci let arr = it.rowId!.split('-').reverse(); 538fb726d48Sopenharmony_ci let ipid = parseInt(arr[0]); 539fb726d48Sopenharmony_ci if (this.diskIOipids.indexOf(ipid) === -1) { 540fb726d48Sopenharmony_ci this.diskIOipids.push(ipid); 541fb726d48Sopenharmony_ci } 542fb726d48Sopenharmony_ci if (arr[1] === 'read') { 543fb726d48Sopenharmony_ci this.diskIOReadIds.indexOf(ipid) === -1 ? this.diskIOReadIds.push(ipid) : ''; 544fb726d48Sopenharmony_ci } else if (arr[1] === 'write') { 545fb726d48Sopenharmony_ci this.diskIOWriteIds.indexOf(ipid) === -1 ? this.diskIOWriteIds.push(ipid) : ''; 546fb726d48Sopenharmony_ci } 547fb726d48Sopenharmony_ci } 548fb726d48Sopenharmony_ci } 549fb726d48Sopenharmony_ci } 550fb726d48Sopenharmony_ci } 551fb726d48Sopenharmony_ci // @ts-ignore 552fb726d48Sopenharmony_ci vMTrackerGpuChildRowsEvery(item: TraceRow<unknown>): void { 553fb726d48Sopenharmony_ci item.rangeSelect = true; 554fb726d48Sopenharmony_ci if (item.rowType === TraceRow.ROW_TYPE_GPU_MEMORY_VMTRACKER) { 555fb726d48Sopenharmony_ci this.gpuMemoryTrackerData.push(...intersectData(item)!); 556fb726d48Sopenharmony_ci } else if (item.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_GL) { 557fb726d48Sopenharmony_ci this.gpu.gl = 558fb726d48Sopenharmony_ci item.dataListCache.filter( 559fb726d48Sopenharmony_ci (it) => 560fb726d48Sopenharmony_ci // @ts-ignore 561fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 562fb726d48Sopenharmony_ci // @ts-ignore 563fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 564fb726d48Sopenharmony_ci ).length > 0; 565fb726d48Sopenharmony_ci } else if (item.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_GRAPH) { 566fb726d48Sopenharmony_ci this.gpu.graph = 567fb726d48Sopenharmony_ci item.dataListCache.filter( 568fb726d48Sopenharmony_ci // @ts-ignore 569fb726d48Sopenharmony_ci (it) => 570fb726d48Sopenharmony_ci // @ts-ignore 571fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 572fb726d48Sopenharmony_ci // @ts-ignore 573fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 574fb726d48Sopenharmony_ci ).length > 0; 575fb726d48Sopenharmony_ci } else if (item.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_TOTAL) { 576fb726d48Sopenharmony_ci this.gpu.gpuTotal = 577fb726d48Sopenharmony_ci item.dataListCache.filter( 578fb726d48Sopenharmony_ci (it) => 579fb726d48Sopenharmony_ci // @ts-ignore 580fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 581fb726d48Sopenharmony_ci // @ts-ignore 582fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 583fb726d48Sopenharmony_ci ).length > 0; 584fb726d48Sopenharmony_ci } else if (item.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_WINDOW) { 585fb726d48Sopenharmony_ci this.gpu.gpuWindow = 586fb726d48Sopenharmony_ci item.dataListCache.filter( 587fb726d48Sopenharmony_ci (it) => 588fb726d48Sopenharmony_ci // @ts-ignore 589fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 590fb726d48Sopenharmony_ci // @ts-ignore 591fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 592fb726d48Sopenharmony_ci ).length > 0; 593fb726d48Sopenharmony_ci } 594fb726d48Sopenharmony_ci } 595fb726d48Sopenharmony_ci // @ts-ignore 596fb726d48Sopenharmony_ci pushVmTracker(it: TraceRow<unknown>, sp: SpSystemTrace): void { 597fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_VM_TRACKER) { 598fb726d48Sopenharmony_ci // @ts-ignore 599fb726d48Sopenharmony_ci let vMTrackerChildRows: Array<TraceRow<unknown>> = [ 600fb726d48Sopenharmony_ci // @ts-ignore 601fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${it.rowId}']`), 602fb726d48Sopenharmony_ci ]; 603fb726d48Sopenharmony_ci if (!it.expansion) { 604fb726d48Sopenharmony_ci vMTrackerChildRows = [...it.childrenList]; 605fb726d48Sopenharmony_ci } 606fb726d48Sopenharmony_ci vMTrackerChildRows.forEach((th) => { 607fb726d48Sopenharmony_ci th.rangeSelect = true; 608fb726d48Sopenharmony_ci if (th.rowType === TraceRow.ROW_TYPE_DMA_VMTRACKER) { 609fb726d48Sopenharmony_ci this.dmaVmTrackerData.push(...intersectData(th)!); 610fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU) { 611fb726d48Sopenharmony_ci // @ts-ignore 612fb726d48Sopenharmony_ci let vMTrackerGpuChildRows: Array<TraceRow<unknown>> = [ 613fb726d48Sopenharmony_ci // @ts-ignore 614fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${th.rowId}']`), 615fb726d48Sopenharmony_ci ]; 616fb726d48Sopenharmony_ci if (!th.expansion) { 617fb726d48Sopenharmony_ci vMTrackerGpuChildRows = [...th.childrenList]; 618fb726d48Sopenharmony_ci } 619fb726d48Sopenharmony_ci vMTrackerGpuChildRows.forEach((item) => { 620fb726d48Sopenharmony_ci this.vMTrackerGpuChildRowsEvery(item); 621fb726d48Sopenharmony_ci }); 622fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_PURGEABLE_TOTAL_VM) { 623fb726d48Sopenharmony_ci this.purgeableTotalVM.push(...intersectData(th)); 624fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_PURGEABLE_PIN_VM) { 625fb726d48Sopenharmony_ci this.purgeablePinVM.push(...intersectData(th)); 626fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_VM_TRACKER_SMAPS) { 627fb726d48Sopenharmony_ci // @ts-ignore 628fb726d48Sopenharmony_ci let sMapsChildRows: Array<TraceRow<unknown>> = [ 629fb726d48Sopenharmony_ci // @ts-ignore 630fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${th.rowId}']`), 631fb726d48Sopenharmony_ci ]; 632fb726d48Sopenharmony_ci if (!th.expansion) { 633fb726d48Sopenharmony_ci sMapsChildRows = [...th.childrenList]; 634fb726d48Sopenharmony_ci } 635fb726d48Sopenharmony_ci sMapsChildRows.forEach((item) => { 636fb726d48Sopenharmony_ci item.rangeSelect = true; 637fb726d48Sopenharmony_ci if (item.rowType === TraceRow.ROW_TYPE_VM_TRACKER_SMAPS) { 638fb726d48Sopenharmony_ci this.smapsType.push(...intersectData(item)!); 639fb726d48Sopenharmony_ci } 640fb726d48Sopenharmony_ci }); 641fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_VMTRACKER_SHM) { 642fb726d48Sopenharmony_ci this.vmtrackershm.push(...intersectData(th)!); 643fb726d48Sopenharmony_ci } 644fb726d48Sopenharmony_ci }); 645fb726d48Sopenharmony_ci } 646fb726d48Sopenharmony_ci } 647fb726d48Sopenharmony_ci 648fb726d48Sopenharmony_ci // @ts-ignore 649fb726d48Sopenharmony_ci pushJank(it: TraceRow<unknown>, sp: SpSystemTrace): void { 650fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_JANK) { 651fb726d48Sopenharmony_ci let isIntersect = (filterJank: JanksStruct, rangeData: RangeSelectStruct): boolean => 652fb726d48Sopenharmony_ci Math.max(filterJank.ts! + filterJank.dur!, rangeData!.endNS || 0) - 653fb726d48Sopenharmony_ci Math.min(filterJank.ts!, rangeData!.startNS || 0) < 654fb726d48Sopenharmony_ci filterJank.dur! + (rangeData!.endNS || 0) - (rangeData!.startNS || 0); 655fb726d48Sopenharmony_ci if (it.name === 'Actual Timeline') { 656fb726d48Sopenharmony_ci if (it.rowParentId === 'frameTime') { 657fb726d48Sopenharmony_ci it.dataListCache.forEach((jankData: unknown) => { 658fb726d48Sopenharmony_ci // @ts-ignore 659fb726d48Sopenharmony_ci if (isIntersect(jankData, TraceRow.rangeSelectObject!)) { 660fb726d48Sopenharmony_ci this.jankFramesData.push(jankData); 661fb726d48Sopenharmony_ci } 662fb726d48Sopenharmony_ci }); 663fb726d48Sopenharmony_ci } else { 664fb726d48Sopenharmony_ci this.jankFramesData.push(it.rowParentId); 665fb726d48Sopenharmony_ci } 666fb726d48Sopenharmony_ci } else if (it.folder) { 667fb726d48Sopenharmony_ci this.jankFramesData = []; 668fb726d48Sopenharmony_ci it.childrenList.forEach((child) => { 669fb726d48Sopenharmony_ci if (child.rowType === TraceRow.ROW_TYPE_JANK && child.name === 'Actual Timeline') { 670fb726d48Sopenharmony_ci if (child.rowParentId === 'frameTime') { 671fb726d48Sopenharmony_ci child.dataListCache.forEach((jankData: unknown) => { 672fb726d48Sopenharmony_ci // @ts-ignore 673fb726d48Sopenharmony_ci if (isIntersect(jankData, TraceRow.rangeSelectObject!)) { 674fb726d48Sopenharmony_ci this.jankFramesData.push(jankData); 675fb726d48Sopenharmony_ci } 676fb726d48Sopenharmony_ci }); 677fb726d48Sopenharmony_ci } else { 678fb726d48Sopenharmony_ci this.jankFramesData.push(child.rowParentId); 679fb726d48Sopenharmony_ci } 680fb726d48Sopenharmony_ci } 681fb726d48Sopenharmony_ci }); 682fb726d48Sopenharmony_ci } 683fb726d48Sopenharmony_ci } 684fb726d48Sopenharmony_ci } 685fb726d48Sopenharmony_ci 686fb726d48Sopenharmony_ci // @ts-ignore 687fb726d48Sopenharmony_ci pushHeapTimeline(it: TraceRow<unknown>, sp: SpSystemTrace): void { 688fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HEAP_TIMELINE) { 689fb726d48Sopenharmony_ci const [rangeStart, rangeEnd] = [TraceRow.range?.startNS, TraceRow.range?.endNS]; 690fb726d48Sopenharmony_ci const startNS = TraceRow.rangeSelectObject?.startNS || rangeStart; 691fb726d48Sopenharmony_ci const endNS = TraceRow.rangeSelectObject?.endNS || rangeEnd; 692fb726d48Sopenharmony_ci let minNodeId; 693fb726d48Sopenharmony_ci let maxNodeId; 694fb726d48Sopenharmony_ci if (!it.dataListCache || it.dataListCache.length === 0) { 695fb726d48Sopenharmony_ci return; 696fb726d48Sopenharmony_ci } 697fb726d48Sopenharmony_ci for (let sample of it.dataListCache) { 698fb726d48Sopenharmony_ci // @ts-ignore 699fb726d48Sopenharmony_ci if (sample.timestamp * 1000 <= startNS!) { 700fb726d48Sopenharmony_ci // @ts-ignore 701fb726d48Sopenharmony_ci minNodeId = sample.lastAssignedId; 702fb726d48Sopenharmony_ci } 703fb726d48Sopenharmony_ci // 个别文件的sample的最大timestamp小于时间的框选结束时间,不能给maxNodeId赋值 704fb726d48Sopenharmony_ci // 所以加上此条件:sample.timestamp === it.dataListCache[it.dataListCache.length -1].timestamp 705fb726d48Sopenharmony_ci if ( 706fb726d48Sopenharmony_ci // @ts-ignore 707fb726d48Sopenharmony_ci sample.timestamp * 1000 >= endNS! || 708fb726d48Sopenharmony_ci // @ts-ignore 709fb726d48Sopenharmony_ci sample.timestamp === it.dataListCache[it.dataListCache.length - 1].timestamp 710fb726d48Sopenharmony_ci ) { 711fb726d48Sopenharmony_ci if (maxNodeId === undefined) { 712fb726d48Sopenharmony_ci // @ts-ignore 713fb726d48Sopenharmony_ci maxNodeId = sample.lastAssignedId; 714fb726d48Sopenharmony_ci } 715fb726d48Sopenharmony_ci } 716fb726d48Sopenharmony_ci } 717fb726d48Sopenharmony_ci 718fb726d48Sopenharmony_ci // If the start time range of the selected box is greater than the end time of the sampled data 719fb726d48Sopenharmony_ci // @ts-ignore 720fb726d48Sopenharmony_ci if (startNS! >= it.dataListCache[it.dataListCache.length - 1].timestamp * 1000) { 721fb726d48Sopenharmony_ci // @ts-ignore 722fb726d48Sopenharmony_ci minNodeId = it.dataListCache[it.dataListCache.length - 1].lastAssignedId; 723fb726d48Sopenharmony_ci } 724fb726d48Sopenharmony_ci // If you select the box from the beginning 725fb726d48Sopenharmony_ci if (startNS! <= rangeStart!) { 726fb726d48Sopenharmony_ci minNodeId = HeapDataInterface.getInstance().getMinNodeId(sp.snapshotFiles!.id); 727fb726d48Sopenharmony_ci } 728fb726d48Sopenharmony_ci //If you select the box from the ending 729fb726d48Sopenharmony_ci // @ts-ignore 730fb726d48Sopenharmony_ci if (endNS! >= rangeEnd! || endNS! >= it.dataListCache[it.dataListCache.length - 1].timestampUs * 1000) { 731fb726d48Sopenharmony_ci maxNodeId = HeapDataInterface.getInstance().getMaxNodeId(sp.snapshotFiles!.id); 732fb726d48Sopenharmony_ci } 733fb726d48Sopenharmony_ci let summary = (sp.traceSheetEL!.shadowRoot!.querySelector('#tabs') as LitTabs) 734fb726d48Sopenharmony_ci .querySelector('#box-heap-summary') 735fb726d48Sopenharmony_ci ?.querySelector('tabpane-summary') as TabPaneSummary; 736fb726d48Sopenharmony_ci summary.initSummaryData(sp.snapshotFiles!, minNodeId, maxNodeId); 737fb726d48Sopenharmony_ci this.jsMemory.push(1); 738fb726d48Sopenharmony_ci } 739fb726d48Sopenharmony_ci } 740fb726d48Sopenharmony_ci 741fb726d48Sopenharmony_ci // @ts-ignore 742fb726d48Sopenharmony_ci pushJsCpuProfiler(it: TraceRow<unknown>, sp: SpSystemTrace): void { 743fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_JS_CPU_PROFILER) { 744fb726d48Sopenharmony_ci let isIntersect = (a: JsCpuProfilerStruct, b: RangeSelectStruct): boolean => 745fb726d48Sopenharmony_ci Math.max(a.startTime! + a.totalTime!, b!.endNS || 0) - Math.min(a.startTime!, b!.startNS || 0) < 746fb726d48Sopenharmony_ci a.totalTime! + (b!.endNS || 0) - (b!.startNS || 0); 747fb726d48Sopenharmony_ci let frameSelectData = it.dataListCache.filter((frameSelectData: unknown) => { 748fb726d48Sopenharmony_ci // @ts-ignore 749fb726d48Sopenharmony_ci return isIntersect(frameSelectData, TraceRow.rangeSelectObject!); 750fb726d48Sopenharmony_ci }); 751fb726d48Sopenharmony_ci let copyFrameSelectData = JSON.parse(JSON.stringify(frameSelectData)); 752fb726d48Sopenharmony_ci let frameSelectDataIdArr: Array<number> = []; 753fb726d48Sopenharmony_ci for (let data of copyFrameSelectData) { 754fb726d48Sopenharmony_ci frameSelectDataIdArr.push(data.id); 755fb726d48Sopenharmony_ci } 756fb726d48Sopenharmony_ci let jsCpuProfilerData = copyFrameSelectData.filter((item: JsCpuProfilerChartFrame) => { 757fb726d48Sopenharmony_ci // @ts-ignore 758fb726d48Sopenharmony_ci if (item.depth === 0) { 759fb726d48Sopenharmony_ci // @ts-ignore 760fb726d48Sopenharmony_ci setSelectState(item, frameSelectDataIdArr); 761fb726d48Sopenharmony_ci // @ts-ignore 762fb726d48Sopenharmony_ci item.isSelect = true; 763fb726d48Sopenharmony_ci } 764fb726d48Sopenharmony_ci return item.depth === 0; 765fb726d48Sopenharmony_ci }); 766fb726d48Sopenharmony_ci this.jsCpuProfilerData = jsCpuProfilerData; 767fb726d48Sopenharmony_ci } 768fb726d48Sopenharmony_ci } 769fb726d48Sopenharmony_ci 770fb726d48Sopenharmony_ci // @ts-ignore 771fb726d48Sopenharmony_ci pushSysMemoryGpu(it: TraceRow<unknown>, sp: SpSystemTrace): void { 772fb726d48Sopenharmony_ci // @ts-ignore 773fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU) { 774fb726d48Sopenharmony_ci // @ts-ignore 775fb726d48Sopenharmony_ci let vMTrackerGpuChildRows: Array<TraceRow<unknown>> = [ 776fb726d48Sopenharmony_ci // @ts-ignore 777fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${it.rowId}']`), 778fb726d48Sopenharmony_ci ]; 779fb726d48Sopenharmony_ci if (!it.expansion) { 780fb726d48Sopenharmony_ci vMTrackerGpuChildRows = [...it.childrenList]; 781fb726d48Sopenharmony_ci } 782fb726d48Sopenharmony_ci vMTrackerGpuChildRows.forEach((th) => { 783fb726d48Sopenharmony_ci th.rangeSelect = true; 784fb726d48Sopenharmony_ci if (th.rowType === TraceRow.ROW_TYPE_GPU_MEMORY_VMTRACKER) { 785fb726d48Sopenharmony_ci this.gpuMemoryTrackerData.push(...intersectData(th)!); 786fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_GL) { 787fb726d48Sopenharmony_ci this.gpu.gl = 788fb726d48Sopenharmony_ci th.dataListCache.filter( 789fb726d48Sopenharmony_ci (it) => 790fb726d48Sopenharmony_ci // @ts-ignore 791fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 792fb726d48Sopenharmony_ci // @ts-ignore 793fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 794fb726d48Sopenharmony_ci ).length > 0; 795fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_GRAPH) { 796fb726d48Sopenharmony_ci this.gpu.graph = 797fb726d48Sopenharmony_ci th.dataListCache.filter( 798fb726d48Sopenharmony_ci (it) => 799fb726d48Sopenharmony_ci // @ts-ignore 800fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 801fb726d48Sopenharmony_ci // @ts-ignore 802fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 803fb726d48Sopenharmony_ci ).length > 0; 804fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_TOTAL) { 805fb726d48Sopenharmony_ci this.gpu.gpuTotal = 806fb726d48Sopenharmony_ci th.dataListCache.filter( 807fb726d48Sopenharmony_ci (it) => 808fb726d48Sopenharmony_ci // @ts-ignore 809fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 810fb726d48Sopenharmony_ci // @ts-ignore 811fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 812fb726d48Sopenharmony_ci ).length > 0; 813fb726d48Sopenharmony_ci } else if (th.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_WINDOW) { 814fb726d48Sopenharmony_ci this.gpu.gpuWindow = 815fb726d48Sopenharmony_ci th.dataListCache.filter( 816fb726d48Sopenharmony_ci (it) => 817fb726d48Sopenharmony_ci // @ts-ignore 818fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 819fb726d48Sopenharmony_ci // @ts-ignore 820fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 821fb726d48Sopenharmony_ci ).length > 0; 822fb726d48Sopenharmony_ci } 823fb726d48Sopenharmony_ci }); 824fb726d48Sopenharmony_ci } 825fb726d48Sopenharmony_ci } 826fb726d48Sopenharmony_ci 827fb726d48Sopenharmony_ci // @ts-ignore 828fb726d48Sopenharmony_ci pushSDK(it: TraceRow<unknown>, sp: SpSystemTrace): void { 829fb726d48Sopenharmony_ci if (it.rowType?.startsWith(TraceRow.ROW_TYPE_SDK)) { 830fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SDK) { 831fb726d48Sopenharmony_ci // @ts-ignore 832fb726d48Sopenharmony_ci let sdkRows: Array<TraceRow<unknown>> = [ 833fb726d48Sopenharmony_ci // @ts-ignore 834fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${it.rowId}']`), 835fb726d48Sopenharmony_ci ]; 836fb726d48Sopenharmony_ci if (!it.expansion) { 837fb726d48Sopenharmony_ci sdkRows = [...it.childrenList]; 838fb726d48Sopenharmony_ci } 839fb726d48Sopenharmony_ci sdkRows.forEach((th) => { 840fb726d48Sopenharmony_ci th.rangeSelect = true; 841fb726d48Sopenharmony_ci th.checkType = '2'; 842fb726d48Sopenharmony_ci }); 843fb726d48Sopenharmony_ci } 844fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SDK_COUNTER) { 845fb726d48Sopenharmony_ci this.sdkCounterIds.push(it.rowId!); 846fb726d48Sopenharmony_ci } 847fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SDK_SLICE) { 848fb726d48Sopenharmony_ci this.sdkSliceIds.push(it.rowId!); 849fb726d48Sopenharmony_ci } 850fb726d48Sopenharmony_ci } 851fb726d48Sopenharmony_ci } 852fb726d48Sopenharmony_ci 853fb726d48Sopenharmony_ci // @ts-ignore 854fb726d48Sopenharmony_ci pushVmTrackerSmaps(it: TraceRow<unknown>, sp: SpSystemTrace): void { 855fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_VM_TRACKER_SMAPS) { 856fb726d48Sopenharmony_ci this.smapsType.push(...intersectData(it)!); 857fb726d48Sopenharmony_ci // @ts-ignore 858fb726d48Sopenharmony_ci let sMapsChildRows: Array<TraceRow<unknown>> = [ 859fb726d48Sopenharmony_ci // @ts-ignore 860fb726d48Sopenharmony_ci ...sp.shadowRoot!.querySelectorAll<TraceRow<unknown>>(`trace-row[row-parent-id='${it.rowId}']`), 861fb726d48Sopenharmony_ci ]; 862fb726d48Sopenharmony_ci if (!it.expansion) { 863fb726d48Sopenharmony_ci sMapsChildRows = [...it.childrenList]; 864fb726d48Sopenharmony_ci } 865fb726d48Sopenharmony_ci sMapsChildRows.forEach((item) => { 866fb726d48Sopenharmony_ci item.rangeSelect = true; 867fb726d48Sopenharmony_ci if (item.rowType === TraceRow.ROW_TYPE_VM_TRACKER_SMAPS) { 868fb726d48Sopenharmony_ci this.smapsType.push(...intersectData(item)!); 869fb726d48Sopenharmony_ci } 870fb726d48Sopenharmony_ci }); 871fb726d48Sopenharmony_ci } 872fb726d48Sopenharmony_ci } 873fb726d48Sopenharmony_ci 874fb726d48Sopenharmony_ci // @ts-ignore 875fb726d48Sopenharmony_ci pushIrq(it: TraceRow<unknown>): void { 876fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_IRQ_GROUP) { 877fb726d48Sopenharmony_ci it.childrenList.forEach((child) => { 878fb726d48Sopenharmony_ci child.rangeSelect = true; 879fb726d48Sopenharmony_ci child.checkType = '2'; 880fb726d48Sopenharmony_ci this.pushIrq(child); 881fb726d48Sopenharmony_ci }); 882fb726d48Sopenharmony_ci } 883fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_IRQ) { 884fb726d48Sopenharmony_ci let filterId = parseInt(it.getAttribute('callId') || '-1'); 885fb726d48Sopenharmony_ci if (it.getAttribute('cat') === 'irq') { 886fb726d48Sopenharmony_ci if (this.irqCallIds.indexOf(filterId) === -1) { 887fb726d48Sopenharmony_ci this.irqCallIds.push(filterId); 888fb726d48Sopenharmony_ci } 889fb726d48Sopenharmony_ci } else { 890fb726d48Sopenharmony_ci if (this.softIrqCallIds.indexOf(filterId) === -1) { 891fb726d48Sopenharmony_ci this.softIrqCallIds.push(filterId); 892fb726d48Sopenharmony_ci } 893fb726d48Sopenharmony_ci } 894fb726d48Sopenharmony_ci } 895fb726d48Sopenharmony_ci } 896fb726d48Sopenharmony_ci 897fb726d48Sopenharmony_ci // @ts-ignore 898fb726d48Sopenharmony_ci pushSysMemoryGpuGl(it: TraceRow<unknown>, sp: SpSystemTrace): void { 899fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_GL) { 900fb726d48Sopenharmony_ci this.gpu.gl = 901fb726d48Sopenharmony_ci it.dataListCache.filter( 902fb726d48Sopenharmony_ci (it) => 903fb726d48Sopenharmony_ci // @ts-ignore 904fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 905fb726d48Sopenharmony_ci // @ts-ignore 906fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 907fb726d48Sopenharmony_ci ).length > 0; 908fb726d48Sopenharmony_ci } 909fb726d48Sopenharmony_ci } 910fb726d48Sopenharmony_ci 911fb726d48Sopenharmony_ci // @ts-ignore 912fb726d48Sopenharmony_ci pushFrameDynamic(it: TraceRow<unknown>, sp: SpSystemTrace): void { 913fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_FRAME_DYNAMIC) { 914fb726d48Sopenharmony_ci let appName = it.getAttribute('model-name'); 915fb726d48Sopenharmony_ci let isSelect = (dynamicStruct: FrameDynamicStruct, b: RangeSelectStruct): boolean => 916fb726d48Sopenharmony_ci dynamicStruct.ts >= b.startNS! && dynamicStruct.ts <= b.endNS!; 917fb726d48Sopenharmony_ci let frameDynamicList = it.dataListCache.filter( 918fb726d48Sopenharmony_ci // @ts-ignore 919fb726d48Sopenharmony_ci (frameAnimationBean: FrameDynamicStruct) => 920fb726d48Sopenharmony_ci isSelect(frameAnimationBean, TraceRow.rangeSelectObject!) && 921fb726d48Sopenharmony_ci frameAnimationBean.groupId !== -1 && 922fb726d48Sopenharmony_ci frameAnimationBean.appName === appName 923fb726d48Sopenharmony_ci ); 924fb726d48Sopenharmony_ci // @ts-ignore 925fb726d48Sopenharmony_ci this.frameDynamic.push(...frameDynamicList); 926fb726d48Sopenharmony_ci } 927fb726d48Sopenharmony_ci } 928fb726d48Sopenharmony_ci 929fb726d48Sopenharmony_ci // @ts-ignore 930fb726d48Sopenharmony_ci pushFrameSpacing(it: TraceRow<unknown>): void { 931fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_FRAME_SPACING) { 932fb726d48Sopenharmony_ci let appName = it.getAttribute('model-name'); 933fb726d48Sopenharmony_ci let isSelect = (a: FrameSpacingStruct, b: RangeSelectStruct): boolean => 934fb726d48Sopenharmony_ci a.currentTs >= b.startNS! && a.currentTs <= b.endNS!; 935fb726d48Sopenharmony_ci // @ts-ignore 936fb726d48Sopenharmony_ci let frameDatas = it.dataListCache.filter((frameData: FrameSpacingStruct) => { 937fb726d48Sopenharmony_ci return ( 938fb726d48Sopenharmony_ci isSelect(frameData, TraceRow.rangeSelectObject!) && 939fb726d48Sopenharmony_ci frameData.groupId !== -1 && 940fb726d48Sopenharmony_ci frameData.frameSpacingResult !== -1 && 941fb726d48Sopenharmony_ci frameData.nameId === appName 942fb726d48Sopenharmony_ci ); 943fb726d48Sopenharmony_ci }); 944fb726d48Sopenharmony_ci // @ts-ignore 945fb726d48Sopenharmony_ci this.frameSpacing.push(...frameDatas); 946fb726d48Sopenharmony_ci } 947fb726d48Sopenharmony_ci } 948fb726d48Sopenharmony_ci 949fb726d48Sopenharmony_ci // @ts-ignore 950fb726d48Sopenharmony_ci pushFrameAnimation(it: TraceRow<unknown>): void { 951fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_FRAME_ANIMATION) { 952fb726d48Sopenharmony_ci let isIntersect = (animationStruct: FrameAnimationStruct, selectStruct: RangeSelectStruct): boolean => 953fb726d48Sopenharmony_ci Math.max(animationStruct.startTs! + animationStruct.dur!, selectStruct!.endNS || 0) - 954fb726d48Sopenharmony_ci Math.min(animationStruct.startTs!, selectStruct!.startNS || 0) < 955fb726d48Sopenharmony_ci animationStruct.dur! + (selectStruct!.endNS || 0) - (selectStruct!.startNS || 0); 956fb726d48Sopenharmony_ci // @ts-ignore 957fb726d48Sopenharmony_ci let frameAnimationList = it.dataListCache.filter((frameAnimationBean: FrameAnimationStruct) => { 958fb726d48Sopenharmony_ci return isIntersect(frameAnimationBean, TraceRow.rangeSelectObject!); 959fb726d48Sopenharmony_ci }); 960fb726d48Sopenharmony_ci // @ts-ignore 961fb726d48Sopenharmony_ci this.frameAnimation.push(...frameAnimationList); 962fb726d48Sopenharmony_ci } 963fb726d48Sopenharmony_ci } 964fb726d48Sopenharmony_ci 965fb726d48Sopenharmony_ci // @ts-ignore 966fb726d48Sopenharmony_ci pushSysMemoryGpuWindow(it: TraceRow<unknown>): void { 967fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_WINDOW) { 968fb726d48Sopenharmony_ci this.gpu.gpuWindow = 969fb726d48Sopenharmony_ci it.dataListCache.filter( 970fb726d48Sopenharmony_ci (it) => 971fb726d48Sopenharmony_ci // @ts-ignore 972fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 973fb726d48Sopenharmony_ci // @ts-ignore 974fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 975fb726d48Sopenharmony_ci ).length > 0; 976fb726d48Sopenharmony_ci } 977fb726d48Sopenharmony_ci } 978fb726d48Sopenharmony_ci 979fb726d48Sopenharmony_ci // @ts-ignore 980fb726d48Sopenharmony_ci pushSysMemoryGpuTotal(it: TraceRow<unknown>): void { 981fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_TOTAL) { 982fb726d48Sopenharmony_ci this.gpu.gpuTotal = 983fb726d48Sopenharmony_ci it.dataListCache.filter( 984fb726d48Sopenharmony_ci (it) => 985fb726d48Sopenharmony_ci // @ts-ignore 986fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 987fb726d48Sopenharmony_ci // @ts-ignore 988fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 989fb726d48Sopenharmony_ci ).length > 0; 990fb726d48Sopenharmony_ci } 991fb726d48Sopenharmony_ci } 992fb726d48Sopenharmony_ci 993fb726d48Sopenharmony_ci // @ts-ignore 994fb726d48Sopenharmony_ci pushSysMemoryGpuGraph(it: TraceRow<unknown>): void { 995fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SYS_MEMORY_GPU_GRAPH) { 996fb726d48Sopenharmony_ci this.gpu.graph = 997fb726d48Sopenharmony_ci it.dataListCache.filter( 998fb726d48Sopenharmony_ci (it) => 999fb726d48Sopenharmony_ci // @ts-ignore 1000fb726d48Sopenharmony_ci (it.startNs >= this.leftNs && it.startNs <= this.rightNs) || 1001fb726d48Sopenharmony_ci // @ts-ignore 1002fb726d48Sopenharmony_ci (it.endNs >= this.leftNs && it.endNs <= this.rightNs) 1003fb726d48Sopenharmony_ci ).length > 0; 1004fb726d48Sopenharmony_ci } 1005fb726d48Sopenharmony_ci } 1006fb726d48Sopenharmony_ci 1007fb726d48Sopenharmony_ci // @ts-ignore 1008fb726d48Sopenharmony_ci pushStaticInit(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1009fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_STATIC_INIT) { 1010fb726d48Sopenharmony_ci this.staticInit = true; 1011fb726d48Sopenharmony_ci sp.pushPidToSelection(this, it.rowParentId!); 1012fb726d48Sopenharmony_ci info('load thread traceRow id is : ', it.rowId); 1013fb726d48Sopenharmony_ci } 1014fb726d48Sopenharmony_ci } 1015fb726d48Sopenharmony_ci 1016fb726d48Sopenharmony_ci // @ts-ignore 1017fb726d48Sopenharmony_ci pushAppStartUp(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1018fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_APP_STARTUP) { 1019fb726d48Sopenharmony_ci this.startup = true; 1020fb726d48Sopenharmony_ci sp.pushPidToSelection(this, it.rowParentId!); 1021fb726d48Sopenharmony_ci info('load thread traceRow id is : ', it.rowId); 1022fb726d48Sopenharmony_ci } 1023fb726d48Sopenharmony_ci } 1024fb726d48Sopenharmony_ci 1025fb726d48Sopenharmony_ci // @ts-ignore 1026fb726d48Sopenharmony_ci pushThread(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1027fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_THREAD) { 1028fb726d48Sopenharmony_ci sp.pushPidToSelection(this, it.rowParentId!, it.protoPid); 1029fb726d48Sopenharmony_ci if (it.dataListCache && it.dataListCache.length) { 1030fb726d48Sopenharmony_ci //@ts-ignore 1031fb726d48Sopenharmony_ci let hiTid = it.dataListCache[0]!.tid; 1032fb726d48Sopenharmony_ci this.perfThread.push(parseInt(hiTid)); 1033fb726d48Sopenharmony_ci } 1034fb726d48Sopenharmony_ci this.threadIds.push(parseInt(it.rowId!)); 1035fb726d48Sopenharmony_ci info('load thread traceRow id is : ', it.rowId); 1036fb726d48Sopenharmony_ci } 1037fb726d48Sopenharmony_ci } 1038fb726d48Sopenharmony_ci 1039fb726d48Sopenharmony_ci // @ts-ignore 1040fb726d48Sopenharmony_ci pushVirtualMemory(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1041fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_MEM || it.rowType === TraceRow.ROW_TYPE_VIRTUAL_MEMORY) { 1042fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_MEM) { 1043fb726d48Sopenharmony_ci this.processTrackIds.push(parseInt(it.rowId!)); 1044fb726d48Sopenharmony_ci } else { 1045fb726d48Sopenharmony_ci this.virtualTrackIds.push(parseInt(it.rowId!)); 1046fb726d48Sopenharmony_ci } 1047fb726d48Sopenharmony_ci info('load memory traceRow id is : ', it.rowId); 1048fb726d48Sopenharmony_ci } 1049fb726d48Sopenharmony_ci } 1050fb726d48Sopenharmony_ci 1051fb726d48Sopenharmony_ci // @ts-ignore 1052fb726d48Sopenharmony_ci pushFps(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1053fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_FPS) { 1054fb726d48Sopenharmony_ci this.hasFps = true; 1055fb726d48Sopenharmony_ci info('load FPS traceRow id is : ', it.rowId); 1056fb726d48Sopenharmony_ci } 1057fb726d48Sopenharmony_ci } 1058fb726d48Sopenharmony_ci 1059fb726d48Sopenharmony_ci // @ts-ignore 1060fb726d48Sopenharmony_ci pushCpuAbility(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1061fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CPU_ABILITY) { 1062fb726d48Sopenharmony_ci this.cpuAbilityIds.push(it.rowId!); 1063fb726d48Sopenharmony_ci info('load CPU Ability traceRow id is : ', it.rowId); 1064fb726d48Sopenharmony_ci } 1065fb726d48Sopenharmony_ci } 1066fb726d48Sopenharmony_ci 1067fb726d48Sopenharmony_ci // @ts-ignore 1068fb726d48Sopenharmony_ci pushMemoryAbility(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1069fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_MEMORY_ABILITY) { 1070fb726d48Sopenharmony_ci this.memoryAbilityIds.push(it.rowId!); 1071fb726d48Sopenharmony_ci info('load Memory Ability traceRow id is : ', it.rowId); 1072fb726d48Sopenharmony_ci } 1073fb726d48Sopenharmony_ci } 1074fb726d48Sopenharmony_ci 1075fb726d48Sopenharmony_ci // @ts-ignore 1076fb726d48Sopenharmony_ci pushDiskAbility(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1077fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_DISK_ABILITY) { 1078fb726d48Sopenharmony_ci this.diskAbilityIds.push(it.rowId!); 1079fb726d48Sopenharmony_ci info('load DiskIo Ability traceRow id is : ', it.rowId); 1080fb726d48Sopenharmony_ci } 1081fb726d48Sopenharmony_ci } 1082fb726d48Sopenharmony_ci 1083fb726d48Sopenharmony_ci // @ts-ignore 1084fb726d48Sopenharmony_ci pushNetworkAbility(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1085fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_NETWORK_ABILITY) { 1086fb726d48Sopenharmony_ci this.networkAbilityIds.push(it.rowId!); 1087fb726d48Sopenharmony_ci info('load Network Ability traceRow id is : ', it.rowId); 1088fb726d48Sopenharmony_ci } 1089fb726d48Sopenharmony_ci } 1090fb726d48Sopenharmony_ci 1091fb726d48Sopenharmony_ci // @ts-ignore 1092fb726d48Sopenharmony_ci pushDmaAbility(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1093fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_DMA_ABILITY) { 1094fb726d48Sopenharmony_ci this.dmaAbilityData.push(...intersectData(it)!); 1095fb726d48Sopenharmony_ci } 1096fb726d48Sopenharmony_ci } 1097fb726d48Sopenharmony_ci 1098fb726d48Sopenharmony_ci // @ts-ignore 1099fb726d48Sopenharmony_ci pushGpuMemoryAbility(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1100fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_GPU_MEMORY_ABILITY) { 1101fb726d48Sopenharmony_ci this.gpuMemoryAbilityData.push(...intersectData(it)!); 1102fb726d48Sopenharmony_ci } 1103fb726d48Sopenharmony_ci } 1104fb726d48Sopenharmony_ci 1105fb726d48Sopenharmony_ci // @ts-ignore 1106fb726d48Sopenharmony_ci pushPowerEnergy(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1107fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_POWER_ENERGY) { 1108fb726d48Sopenharmony_ci this.powerEnergy.push(it.rowId!); 1109fb726d48Sopenharmony_ci } 1110fb726d48Sopenharmony_ci } 1111fb726d48Sopenharmony_ci 1112fb726d48Sopenharmony_ci // @ts-ignore 1113fb726d48Sopenharmony_ci pushSystemEnergy(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1114fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_SYSTEM_ENERGY) { 1115fb726d48Sopenharmony_ci this.systemEnergy.push(it.rowId!); 1116fb726d48Sopenharmony_ci } 1117fb726d48Sopenharmony_ci } 1118fb726d48Sopenharmony_ci 1119fb726d48Sopenharmony_ci // @ts-ignore 1120fb726d48Sopenharmony_ci pushAnomalyEnergy(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1121fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_ANOMALY_ENERGY) { 1122fb726d48Sopenharmony_ci this.anomalyEnergy.push(it.rowId!); 1123fb726d48Sopenharmony_ci } 1124fb726d48Sopenharmony_ci } 1125fb726d48Sopenharmony_ci 1126fb726d48Sopenharmony_ci // @ts-ignore 1127fb726d48Sopenharmony_ci pushVmTrackerShm(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1128fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_VMTRACKER_SHM) { 1129fb726d48Sopenharmony_ci this.vmtrackershm.push(...intersectData(it)!); 1130fb726d48Sopenharmony_ci } 1131fb726d48Sopenharmony_ci } 1132fb726d48Sopenharmony_ci 1133fb726d48Sopenharmony_ci // @ts-ignore 1134fb726d48Sopenharmony_ci pushClock(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1135fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CLOCK_GROUP) { 1136fb726d48Sopenharmony_ci it.childrenList.forEach((it) => { 1137fb726d48Sopenharmony_ci it.rangeSelect = true; 1138fb726d48Sopenharmony_ci it.checkType = '2'; 1139fb726d48Sopenharmony_ci this.clockMapData.set(it.rowId || '', it.getCacheData); 1140fb726d48Sopenharmony_ci it.rowType === TraceRow.ROW_TYPE_DMA_FENCE && this.dmaFenceNameData.push(it.rowId!); 1141fb726d48Sopenharmony_ci }); 1142fb726d48Sopenharmony_ci } 1143fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_CLOCK) { 1144fb726d48Sopenharmony_ci this.clockMapData.set(it.rowId || '', it.getCacheData); 1145fb726d48Sopenharmony_ci } 1146fb726d48Sopenharmony_ci } 1147fb726d48Sopenharmony_ci 1148fb726d48Sopenharmony_ci //匹配id 1149fb726d48Sopenharmony_ci // @ts-ignore 1150fb726d48Sopenharmony_ci pushDmaFence(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1151fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_DMA_FENCE) { 1152fb726d48Sopenharmony_ci this.dmaFenceNameData.push(it.rowId!); 1153fb726d48Sopenharmony_ci } 1154fb726d48Sopenharmony_ci } 1155fb726d48Sopenharmony_ci 1156fb726d48Sopenharmony_ci // @ts-ignore 1157fb726d48Sopenharmony_ci pushXpower(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1158fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_XPOWER) { 1159fb726d48Sopenharmony_ci it.childrenList.forEach((it) => { 1160fb726d48Sopenharmony_ci it.rangeSelect = true; 1161fb726d48Sopenharmony_ci it.checkType = '2'; 1162fb726d48Sopenharmony_ci this.xpowerMapData.set(it.rowId || '', it.getCacheData); 1163fb726d48Sopenharmony_ci }); 1164fb726d48Sopenharmony_ci } 1165fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_XPOWER_SYSTEM) { 1166fb726d48Sopenharmony_ci this.xpowerMapData.set(it.rowId || '', it.getCacheData); 1167fb726d48Sopenharmony_ci } 1168fb726d48Sopenharmony_ci } 1169fb726d48Sopenharmony_ci 1170fb726d48Sopenharmony_ci // @ts-ignore 1171fb726d48Sopenharmony_ci pushHang(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1172fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HANG_GROUP) { 1173fb726d48Sopenharmony_ci it.childrenList.forEach((it) => { 1174fb726d48Sopenharmony_ci it.rangeSelect = true; 1175fb726d48Sopenharmony_ci it.checkType = '2'; 1176fb726d48Sopenharmony_ci this.hangMapData.set(it.rowId || '', it.getCacheData); 1177fb726d48Sopenharmony_ci }); 1178fb726d48Sopenharmony_ci } 1179fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HANG || it.rowType === TraceRow.ROW_TYPE_HANG_INNER) { 1180fb726d48Sopenharmony_ci this.hangMapData.set(it.rowId || '', it.getCacheData); 1181fb726d48Sopenharmony_ci } 1182fb726d48Sopenharmony_ci } 1183fb726d48Sopenharmony_ci 1184fb726d48Sopenharmony_ci // @ts-ignore 1185fb726d48Sopenharmony_ci pushGpuMemoryVmTracker(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1186fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_GPU_MEMORY_VMTRACKER) { 1187fb726d48Sopenharmony_ci this.gpuMemoryTrackerData.push(...intersectData(it)!); 1188fb726d48Sopenharmony_ci } 1189fb726d48Sopenharmony_ci } 1190fb726d48Sopenharmony_ci 1191fb726d48Sopenharmony_ci // @ts-ignore 1192fb726d48Sopenharmony_ci pushDmaVmTracker(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1193fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_DMA_VMTRACKER) { 1194fb726d48Sopenharmony_ci this.dmaVmTrackerData.push(...intersectData(it)!); 1195fb726d48Sopenharmony_ci } 1196fb726d48Sopenharmony_ci } 1197fb726d48Sopenharmony_ci 1198fb726d48Sopenharmony_ci // @ts-ignore 1199fb726d48Sopenharmony_ci pushPugreable(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1200fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PURGEABLE_TOTAL_ABILITY) { 1201fb726d48Sopenharmony_ci this.purgeableTotalAbility.push(...intersectData(it)); 1202fb726d48Sopenharmony_ci } 1203fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PURGEABLE_PIN_ABILITY) { 1204fb726d48Sopenharmony_ci this.purgeablePinAbility.push(...intersectData(it)); 1205fb726d48Sopenharmony_ci } 1206fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PURGEABLE_TOTAL_VM) { 1207fb726d48Sopenharmony_ci this.purgeableTotalVM.push(...intersectData(it)); 1208fb726d48Sopenharmony_ci } 1209fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PURGEABLE_PIN_VM) { 1210fb726d48Sopenharmony_ci this.purgeablePinVM.push(...intersectData(it)); 1211fb726d48Sopenharmony_ci } 1212fb726d48Sopenharmony_ci } 1213fb726d48Sopenharmony_ci 1214fb726d48Sopenharmony_ci // @ts-ignore 1215fb726d48Sopenharmony_ci pushPugreablePinAbility(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1216fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PURGEABLE_PIN_ABILITY) { 1217fb726d48Sopenharmony_ci this.purgeablePinAbility.push(...intersectData(it)); 1218fb726d48Sopenharmony_ci } 1219fb726d48Sopenharmony_ci } 1220fb726d48Sopenharmony_ci 1221fb726d48Sopenharmony_ci // @ts-ignore 1222fb726d48Sopenharmony_ci pushPugreableTotalVm(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1223fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PURGEABLE_TOTAL_VM) { 1224fb726d48Sopenharmony_ci this.purgeableTotalVM.push(...intersectData(it)); 1225fb726d48Sopenharmony_ci } 1226fb726d48Sopenharmony_ci } 1227fb726d48Sopenharmony_ci 1228fb726d48Sopenharmony_ci // @ts-ignore 1229fb726d48Sopenharmony_ci pushPugreablePinVm(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1230fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_PURGEABLE_PIN_VM) { 1231fb726d48Sopenharmony_ci this.purgeablePinVM.push(...intersectData(it)); 1232fb726d48Sopenharmony_ci } 1233fb726d48Sopenharmony_ci } 1234fb726d48Sopenharmony_ci 1235fb726d48Sopenharmony_ci // @ts-ignore 1236fb726d48Sopenharmony_ci pushLogs(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1237fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_LOGS) { 1238fb726d48Sopenharmony_ci this.hiLogs.push(it.rowId!); 1239fb726d48Sopenharmony_ci } 1240fb726d48Sopenharmony_ci } 1241fb726d48Sopenharmony_ci 1242fb726d48Sopenharmony_ci // @ts-ignore 1243fb726d48Sopenharmony_ci pushHiSysEvent(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1244fb726d48Sopenharmony_ci if (it.rowType === TraceRow.ROW_TYPE_HI_SYSEVENT) { 1245fb726d48Sopenharmony_ci this.hiSysEvents.push(it.rowId!); 1246fb726d48Sopenharmony_ci } 1247fb726d48Sopenharmony_ci } 1248fb726d48Sopenharmony_ci 1249fb726d48Sopenharmony_ci // @ts-ignore 1250fb726d48Sopenharmony_ci pushSelection(it: TraceRow<unknown>, sp: SpSystemTrace): void { 1251fb726d48Sopenharmony_ci this.pushCpus(it); 1252fb726d48Sopenharmony_ci this.pushCpuStateFilterIds(it); 1253fb726d48Sopenharmony_ci this.pushCpuFreqFilter(it); 1254fb726d48Sopenharmony_ci this.pushCpuFreqLimit(it); 1255fb726d48Sopenharmony_ci this.pushProcess(it, sp); 1256fb726d48Sopenharmony_ci this.pushNativeMemory(it, sp); 1257fb726d48Sopenharmony_ci this.pushFunc(it, sp); 1258fb726d48Sopenharmony_ci this.pushHeap(it, sp); 1259fb726d48Sopenharmony_ci this.pushMonitor(it, sp); 1260fb726d48Sopenharmony_ci this.pushHiperf(it, sp); 1261fb726d48Sopenharmony_ci this.pushFileSystem(it, sp); 1262fb726d48Sopenharmony_ci this.pushJank(it, sp); 1263fb726d48Sopenharmony_ci this.pushHeapTimeline(it, sp); 1264fb726d48Sopenharmony_ci this.pushJsCpuProfiler(it, sp); 1265fb726d48Sopenharmony_ci this.pushSysMemoryGpu(it, sp); 1266fb726d48Sopenharmony_ci this.pushSDK(it, sp); 1267fb726d48Sopenharmony_ci this.pushVmTrackerSmaps(it, sp); 1268fb726d48Sopenharmony_ci this.pushIrq(it); 1269fb726d48Sopenharmony_ci this.pushSysMemoryGpuGl(it, sp); 1270fb726d48Sopenharmony_ci this.pushFrameDynamic(it, sp); 1271fb726d48Sopenharmony_ci this.pushFrameSpacing(it); 1272fb726d48Sopenharmony_ci this.pushFrameAnimation(it); 1273fb726d48Sopenharmony_ci this.pushSysMemoryGpuWindow(it); 1274fb726d48Sopenharmony_ci this.pushSysMemoryGpuTotal(it); 1275fb726d48Sopenharmony_ci this.pushSysMemoryGpuGraph(it); 1276fb726d48Sopenharmony_ci this.pushStaticInit(it, sp); 1277fb726d48Sopenharmony_ci this.pushAppStartUp(it, sp); 1278fb726d48Sopenharmony_ci this.pushThread(it, sp); 1279fb726d48Sopenharmony_ci this.pushVirtualMemory(it, sp); 1280fb726d48Sopenharmony_ci this.pushFps(it, sp); 1281fb726d48Sopenharmony_ci this.pushCpuAbility(it, sp); 1282fb726d48Sopenharmony_ci this.pushMemoryAbility(it, sp); 1283fb726d48Sopenharmony_ci this.pushDiskAbility(it, sp); 1284fb726d48Sopenharmony_ci this.pushNetworkAbility(it, sp); 1285fb726d48Sopenharmony_ci this.pushDmaAbility(it, sp); 1286fb726d48Sopenharmony_ci this.pushGpuMemoryAbility(it, sp); 1287fb726d48Sopenharmony_ci this.pushPowerEnergy(it, sp); 1288fb726d48Sopenharmony_ci this.pushSystemEnergy(it, sp); 1289fb726d48Sopenharmony_ci this.pushAnomalyEnergy(it, sp); 1290fb726d48Sopenharmony_ci this.pushVmTracker(it, sp); 1291fb726d48Sopenharmony_ci this.pushVmTrackerShm(it, sp); 1292fb726d48Sopenharmony_ci this.pushClock(it, sp); 1293fb726d48Sopenharmony_ci this.pushDmaFence(it, sp); 1294fb726d48Sopenharmony_ci this.pushHang(it, sp); 1295fb726d48Sopenharmony_ci this.pushGpuMemoryVmTracker(it, sp); 1296fb726d48Sopenharmony_ci this.pushDmaVmTracker(it, sp); 1297fb726d48Sopenharmony_ci this.pushPugreable(it, sp); 1298fb726d48Sopenharmony_ci this.pushLogs(it, sp); 1299fb726d48Sopenharmony_ci this.pushHiSysEvent(it, sp); 1300fb726d48Sopenharmony_ci this.pushSampleData(it); 1301fb726d48Sopenharmony_ci this.pushXpower(it, sp); 1302fb726d48Sopenharmony_ci } 1303fb726d48Sopenharmony_ci} 1304fb726d48Sopenharmony_ci 1305fb726d48Sopenharmony_ciexport class BoxJumpParam { 1306fb726d48Sopenharmony_ci traceId: string | undefined | null; 1307fb726d48Sopenharmony_ci leftNs: number = 0; 1308fb726d48Sopenharmony_ci rightNs: number = 0; 1309fb726d48Sopenharmony_ci cpus: Array<number> = []; 1310fb726d48Sopenharmony_ci state: string = ''; 1311fb726d48Sopenharmony_ci processId: number[] | undefined; 1312fb726d48Sopenharmony_ci threadId: number[] | undefined; 1313fb726d48Sopenharmony_ci isJumpPage: boolean | undefined; 1314fb726d48Sopenharmony_ci currentId: string | undefined | null; 1315fb726d48Sopenharmony_ci} 1316fb726d48Sopenharmony_ci 1317fb726d48Sopenharmony_ciexport class SliceBoxJumpParam { 1318fb726d48Sopenharmony_ci traceId: string | undefined | null; 1319fb726d48Sopenharmony_ci leftNs: number = 0; 1320fb726d48Sopenharmony_ci rightNs: number = 0; 1321fb726d48Sopenharmony_ci processId: Array<number> = []; 1322fb726d48Sopenharmony_ci threadId: Array<number> = []; 1323fb726d48Sopenharmony_ci name: string[] | undefined | null; 1324fb726d48Sopenharmony_ci isJumpPage: boolean | undefined; 1325fb726d48Sopenharmony_ci isSummary: boolean | undefined; 1326fb726d48Sopenharmony_ci} 1327fb726d48Sopenharmony_ci 1328fb726d48Sopenharmony_ciexport class SelectionData { 1329fb726d48Sopenharmony_ci name: string = ''; 1330fb726d48Sopenharmony_ci process: string = ''; 1331fb726d48Sopenharmony_ci pid: string = ''; 1332fb726d48Sopenharmony_ci thread: string = ''; 1333fb726d48Sopenharmony_ci tid: string = ''; 1334fb726d48Sopenharmony_ci wallDuration: number = 0; 1335fb726d48Sopenharmony_ci wallDurationFormat: string = ''; 1336fb726d48Sopenharmony_ci avgDuration: string = ''; 1337fb726d48Sopenharmony_ci maxDuration: number = 0; 1338fb726d48Sopenharmony_ci maxDurationFormat: string = ''; 1339fb726d48Sopenharmony_ci occurrences: number = 0; 1340fb726d48Sopenharmony_ci state: string = ''; 1341fb726d48Sopenharmony_ci trackId: number = 0; 1342fb726d48Sopenharmony_ci delta: string = ''; 1343fb726d48Sopenharmony_ci rate: string = ''; 1344fb726d48Sopenharmony_ci avgWeight: string = ''; 1345fb726d48Sopenharmony_ci count: string = ''; 1346fb726d48Sopenharmony_ci first: string = ''; 1347fb726d48Sopenharmony_ci last: string = ''; 1348fb726d48Sopenharmony_ci min: string = ''; 1349fb726d48Sopenharmony_ci max: string = ''; 1350fb726d48Sopenharmony_ci stateJX: string = ''; 1351fb726d48Sopenharmony_ci cpu: number = 0; 1352fb726d48Sopenharmony_ci recordStartNs: number = 0; 1353fb726d48Sopenharmony_ci leftNs: number = 0; 1354fb726d48Sopenharmony_ci rightNs: number = 0; 1355fb726d48Sopenharmony_ci threadIds: Array<number> = []; 1356fb726d48Sopenharmony_ci ts: number = 0; 1357fb726d48Sopenharmony_ci dur: number = 0; 1358fb726d48Sopenharmony_ci tabTitle: string = ''; 1359fb726d48Sopenharmony_ci allName: string[] | undefined; 1360fb726d48Sopenharmony_ci asyncNames: Array<string> = []; 1361fb726d48Sopenharmony_ci asyncCatNames: Array<string> = []; 1362fb726d48Sopenharmony_ci} 1363fb726d48Sopenharmony_ci 1364fb726d48Sopenharmony_ciexport class Counter { 1365fb726d48Sopenharmony_ci id: number = 0; 1366fb726d48Sopenharmony_ci trackId: number = 0; 1367fb726d48Sopenharmony_ci name: string = ''; 1368fb726d48Sopenharmony_ci value: number = 0; 1369fb726d48Sopenharmony_ci startTime: number = 0; 1370fb726d48Sopenharmony_ci} 1371fb726d48Sopenharmony_ci 1372fb726d48Sopenharmony_ciexport class Fps { 1373fb726d48Sopenharmony_ci startNS: number = 0; 1374fb726d48Sopenharmony_ci timeStr: string = ''; 1375fb726d48Sopenharmony_ci fps: number = 0; 1376fb726d48Sopenharmony_ci} 1377fb726d48Sopenharmony_ci 1378fb726d48Sopenharmony_ciexport class GpuCounter { 1379fb726d48Sopenharmony_ci startNS: number = 0; 1380fb726d48Sopenharmony_ci height: number = 0; 1381fb726d48Sopenharmony_ci dur: number = 0; 1382fb726d48Sopenharmony_ci type: string = ''; 1383fb726d48Sopenharmony_ci startTime: number = 0; 1384fb726d48Sopenharmony_ci frame: object = {}; 1385fb726d48Sopenharmony_ci} 1386