From 4bc017c48a5a9fd10f3fc2e92b03aaa4d1223f2f Mon Sep 17 00:00:00 2001 From: liufei Date: Tue, 3 Sep 2024 11:51:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=E6=B8=85=E9=99=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liufei --- ide/src/trace/SpApplication.ts | 4 +- .../trace/sheet/TabPaneCurrentSelection.ts | 17 +++-- .../trace/sheet/process/TabPaneSliceChild.ts | 62 +++++++++------- .../trace/sheet/process/TabPaneSlices.ts | 33 ++++----- .../trace/database/TabPaneFreqUsageWorker.ts | 66 ++++++++--------- .../ProcedureLogicWorkerNativeNemory.ts | 4 +- .../ProcedureLogicWorkerSchedulingAnalysis.ts | 8 +-- ide/src/trace/database/sql/Func.sql.ts | 72 +++++++++---------- ide/src/trace/database/sql/Memory.sql.ts | 50 +++++++------ .../trace/database/sql/ProcessThread.sql.ts | 30 ++++---- .../database/ui-worker/ProcedureWorkerFunc.ts | 4 +- 11 files changed, 184 insertions(+), 166 deletions(-) diff --git a/ide/src/trace/SpApplication.ts b/ide/src/trace/SpApplication.ts index 635efdf0..71fe515f 100644 --- a/ide/src/trace/SpApplication.ts +++ b/ide/src/trace/SpApplication.ts @@ -607,13 +607,13 @@ export class SpApplication extends BaseElement { let reader: FileReader | null = new FileReader(); reader.readAsText(typeStr); reader.onloadend = (event): void => { - let isIncludeMark = `${reader?.result}`.includes('MarkPositionJSON'); + let isIncludeMark = `${reader?.result}`.includes('MarkPositionJSON'); let typeHeader; if (isIncludeMark) { let markLength = `${reader?.result}`.split('->')[0].replace('MarkPositionJSON', ''); //@ts-ignore typeHeader = ev.slice(markLength.length + parseInt(markLength), markLength.length + parseInt(markLength) + 6); - } else{ + } else { //@ts-ignore typeHeader = ev.slice(0, 6); } diff --git a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts index 91a49807..cd42a631 100644 --- a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts +++ b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts @@ -850,7 +850,7 @@ export class TabPaneCurrentSelection extends BaseElement { this.hangScrollHandler(data, sp, scrollCallback); } - private hangScrollHandler(data: HangStruct, sp: SpSystemTrace, scrollCallback: Function) { + private hangScrollHandler(data: HangStruct, sp: SpSystemTrace, scrollCallback: Function): void { let scrollIcon = this.currentSelectionTbl?.shadowRoot?.querySelector('#scroll-to-process'); scrollIcon?.addEventListener('click', async () => { //@ts-ignore @@ -1226,11 +1226,11 @@ export class TabPaneCurrentSelection extends BaseElement { }); } //点击事件获取唤醒链 - private getWakeupChainClickHandler(fromBean: WakeupBean | undefined, list: unknown[]) { + private getWakeupChainClickHandler(fromBean: WakeupBean | undefined, list: unknown[]): void { this.currentSelectionTbl?.shadowRoot?.querySelector('#wakeup-top')?.addEventListener('click', async () => { this.topChainStr = ''; //@ts-ignore - let currentThread = list.filter((item) => item.name === "Thread")?.[0].value;//点击的当前线程 + let currentThread = list.filter((item) => item.name === 'Thread')?.[0].value;//点击的当前线程 let previouosWakeupThread = Utils.getInstance().getThreadMap().get(fromBean!.tid!) || 'Thread';//唤醒当前线程的上个线程 this.topChainStr = `-->${previouosWakeupThread}[${fromBean!.tid}]-->${currentThread}`; this.getRWakeUpChain(fromBean); @@ -1965,7 +1965,9 @@ export class TabPaneCurrentSelection extends BaseElement { let wakeupTs = wakeup[0].ts as number; let recordStartTs = Utils.getInstance().getRecordStartNS(); let wf = await queryThreadWakeUpFrom(data.id, wakeupTs); + // @ts-ignore if (wf && wf[0]) { + // @ts-ignore wb = wf[0]; if (wb !== null) { wb.wakeupTime = wakeupTs - recordStartTs; @@ -1990,7 +1992,9 @@ export class TabPaneCurrentSelection extends BaseElement { let wakeupTs = wakeup[0].ts as number; let recordStartTs = Utils.getInstance().getRecordStartNS(); let wf = await queryThreadWakeUpFrom(data.itid!, wakeupTs); + // @ts-ignore if (wf && wf[0]) { + // @ts-ignore wb = wf[0]; if (wb !== null) { wb.wakeupTime = wakeupTs - recordStartTs; @@ -2012,6 +2016,7 @@ export class TabPaneCurrentSelection extends BaseElement { let item; // @ts-ignore if (wakeUps !== undefined && wakeUps.length > 0) { + // @ts-ignore item = wakeUps[0]; } return item; @@ -2032,16 +2037,16 @@ export class TabPaneCurrentSelection extends BaseElement { return list; } //递归查找R唤醒链 - getRWakeUpChain(data: WakeupBean | undefined):void { + getRWakeUpChain(data: WakeupBean | undefined): void { this.getRWakeUpChainData(data).then((wakeupFrom: unknown) => { if (wakeupFrom === null) {//当查不到数据时,处理容器状态与样式,展示内容 let wakeupTopContent = this.currentSelectionTbl?.shadowRoot?.getElementById('wakeup-top-content'); let wakeupTopIcon = this.currentSelectionTbl?.shadowRoot?.querySelector('#wakeup-top'); wakeupTopContent!.innerText = 'idle' + this.topChainStr;//处理链顶部 - wakeupTopIcon!.style.display = 'none'; + wakeupTopIcon!.style.display = 'none'; wakeupTopContent!.style.display = 'block'; wakeupTopContent!.style.maxHeight = '100px';//设置最大高度,超出出现滚动条 - wakeupTopContent!.style.overflow = 'auto'; + wakeupTopContent!.style.overflow = 'auto'; return; } //@ts-ignore diff --git a/ide/src/trace/component/trace/sheet/process/TabPaneSliceChild.ts b/ide/src/trace/component/trace/sheet/process/TabPaneSliceChild.ts index 2116a287..9e7e1aaa 100644 --- a/ide/src/trace/component/trace/sheet/process/TabPaneSliceChild.ts +++ b/ide/src/trace/component/trace/sheet/process/TabPaneSliceChild.ts @@ -24,9 +24,9 @@ import { getTabDetails, getGhDetails, getSfDetails } from '../../../../database/ export class TabPaneSliceChild extends BaseElement { private sliceChildTbl: LitTable | null | undefined; private boxChildSource: Array = []; - private sliceChildParam: {param: SliceBoxJumpParam, selection: SelectionParam} | null | undefined; + private sliceChildParam: { param: SliceBoxJumpParam, selection: SelectionParam } | null | undefined; - set data(boxChildValue: {param: SliceBoxJumpParam, selection: SelectionParam | null | undefined}) { + set data(boxChildValue: { param: SliceBoxJumpParam, selection: SelectionParam | null | undefined }) { //切换Tab页 保持childTab数据不变 除非重新点击跳转 if (boxChildValue === this.sliceChildParam || !boxChildValue.param.isJumpPage) { return; @@ -35,10 +35,10 @@ export class TabPaneSliceChild extends BaseElement { this.sliceChildParam = boxChildValue; this.sliceChildTbl!.recycleDataSource = []; //合并SF异步信息,相同pid和tid的name - let sfAsyncFuncMap:Map = new Map(); + let sfAsyncFuncMap: Map = new Map(); let filterSfAsyncFuncName = boxChildValue.selection!.funAsync; if (!boxChildValue.param.isSummary!) { - filterSfAsyncFuncName = filterSfAsyncFuncName.filter((item) => item.name === boxChildValue.param.name![0]) + filterSfAsyncFuncName = filterSfAsyncFuncName.filter((item) => item.name === boxChildValue.param.name![0]); } filterSfAsyncFuncName.forEach((it: { name: string; pid: number, tid: number | undefined }) => { if (sfAsyncFuncMap.has(`${it.pid}-${it.tid}`)) { @@ -49,15 +49,15 @@ export class TabPaneSliceChild extends BaseElement { name: [it.name], pid: it.pid, tid: it.tid - }) + }); } - }) + }); //@ts-ignore this.getDataByDB(boxChildValue, sfAsyncFuncMap, boxChildValue.selection!.funCatAsync); } initElements(): void { - this.sliceChildTbl = this.shadowRoot?.querySelector('#tb-slice-child'); + this.sliceChildTbl = this.shadowRoot?.querySelector('#tb-slice-child'); this.sliceChildTbl!.addEventListener('column-click', (evt): void => { // @ts-ignore this.sortByColumn(evt.detail); @@ -83,23 +83,23 @@ export class TabPaneSliceChild extends BaseElement { } getDataByDB( - val: {param: SliceBoxJumpParam, selection: SelectionParam}, - sfAsyncFuncMap: Map, - ghAsyncFunc:{ threadName: string; pid: number}[]): void { + val: { param: SliceBoxJumpParam, selection: SelectionParam }, + sfAsyncFuncMap: Map, + ghAsyncFunc: { threadName: string; pid: number }[]): void { //获取点击跳转,SF异步Func数据 - let result1 = () => { + let result1 = (): Array => { let promises: unknown[] = []; sfAsyncFuncMap.forEach(async (item: { name: string[]; pid: number, tid: number | undefined }) => { let res = await getSfDetails(item.name, item.pid, item.tid, val.param.leftNs, val.param.rightNs); if (res !== undefined && res.length > 0) { promises.push(...res); } - }) - return promises - } + }); + return promises; + }; //获取点击跳转,GH异步Func数据 - let result2 = () => { + let result2 = (): unknown => { let promises: unknown[] = []; ghAsyncFunc.forEach(async (item: { pid: number; threadName: string }) => { let res = await getGhDetails(val.param.name!, item.threadName, item.pid, val.param.leftNs, val.param.rightNs); @@ -107,33 +107,41 @@ export class TabPaneSliceChild extends BaseElement { promises.push(...res); } }); - return promises - } + return promises; + }; //获取同步Func数据,同步Func数据 - let result3 = async () => { + let result3 = async (): Promise => { let promises: unknown[] = []; let res = await getTabDetails(val.param.name!, val.param.processId, val.param.threadId, val.param.leftNs, val.param.rightNs); if (res !== undefined && res.length > 0) { promises.push(...res); } - return promises - } + return promises; + }; this.sliceChildTbl!.loading = true; Promise.all([result1(), result2(), result3()]).then(res => { this.sliceChildTbl!.loading = false; - let result: any = (res[0] || []).concat(res[1] || []).concat(res[2] || []); + let result: unknown = (res[0] || []).concat(res[1] || []).concat(res[2] || []); this.sliceChildTbl!.loading = false; + // @ts-ignore if (result.length !== null && result.length > 0) { - result.map((e: any) => { + // @ts-ignore + result.map((e: unknown) => { + // @ts-ignore e.startTime = Utils.getTimeString(e.startNs); // @ts-ignore e.absoluteTime = ((window as unknown).recordStartNS + e.startNs) / 1000000000; + // @ts-ignore e.duration = e.duration / 1000000; + // @ts-ignore e.state = Utils.getEndState(e.state)!; + // @ts-ignore e.processName = `${e.process === undefined || e.process === null ? 'process' : e.process}[${e.processId}]`; + // @ts-ignore e.threadName = `${e.thread === undefined || e.thread === null ? 'thread' : e.thread}[${e.threadId}]`; }); + // @ts-ignore this.boxChildSource = result; if (this.sliceChildTbl) { // @ts-ignore @@ -144,9 +152,9 @@ export class TabPaneSliceChild extends BaseElement { if (this.sliceChildTbl) { // @ts-ignore this.sliceChildTbl.recycleDataSource = []; - } - } - }) + }; + } + }); } initHtml(): string { @@ -199,8 +207,8 @@ export class TabPaneSliceChild extends BaseElement { }; } //@ts-ignore - if (detail.key === 'startTime' || detail.key === 'processName'|| detail.key === 'threadName' ||//@ts-ignore - detail.key === 'name') { + if (detail.key === 'startTime' || detail.key === 'processName' || detail.key === 'threadName' ||//@ts-ignore + detail.key === 'name') { // @ts-ignore this.boxChildSource.sort(compare(detail.key, detail.sort, 'string'));// @ts-ignore } else if (detail.key === 'absoluteTime' || detail.key === 'duration') {// @ts-ignore diff --git a/ide/src/trace/component/trace/sheet/process/TabPaneSlices.ts b/ide/src/trace/component/trace/sheet/process/TabPaneSlices.ts index 2790e37f..93151038 100644 --- a/ide/src/trace/component/trace/sheet/process/TabPaneSlices.ts +++ b/ide/src/trace/component/trace/sheet/process/TabPaneSlices.ts @@ -54,9 +54,9 @@ export class TabPaneSlices extends BaseElement { name: [it.name], pid: it.pid, tid: it.tid - }) + }); } - }) + }); let filterNameEL: HTMLInputElement | undefined | null = this.shadowRoot?.querySelector('#filterName'); @@ -66,7 +66,7 @@ export class TabPaneSlices extends BaseElement { } }); - this.getSliceDb(slicesParam, filterNameEL, sfAsyncFuncMap, slicesParam.funCatAsync) + this.getSliceDb(slicesParam, filterNameEL, sfAsyncFuncMap, slicesParam.funCatAsync); } initElements(): void { @@ -114,21 +114,21 @@ export class TabPaneSlices extends BaseElement { slicesParam: SelectionParam, filterNameEL: HTMLInputElement | undefined | null, sfAsyncFuncMap: Map, - ghAsyncFunc: { threadName: string; pid: number }[]) { + ghAsyncFunc: { threadName: string; pid: number }[]): void { //获取SF异步Func数据 - let result1 = () => { + let result1 = (): Array => { let promises: unknown[] = []; sfAsyncFuncMap.forEach(async (item: { name: string[]; pid: number, tid: number | undefined }) => { let res = await getTabSlicesAsyncFunc(item.name, item.pid, item.tid, slicesParam.leftNs, slicesParam.rightNs); if (res !== undefined && res.length > 0) { promises.push(...res); } - }) - return promises - } + }); + return promises; + }; //获取GH异步Func数据 - let result2 = () => { + let result2 = (): Array => { let promises: unknown[] = []; ghAsyncFunc.forEach(async (item: { pid: number; threadName: string }) => { let res = await getTabSlicesAsyncCatFunc(item.threadName, item.pid, slicesParam.leftNs, slicesParam.rightNs); @@ -136,18 +136,18 @@ export class TabPaneSlices extends BaseElement { promises.push(...res); } }); - return promises - } + return promises; + }; //获取同步Func数据 - let result3 = async () => { + let result3 = async (): Promise => { let promises: unknown[] = []; let res = await getTabSlices(slicesParam.funTids, slicesParam.processIds, slicesParam.leftNs, slicesParam.rightNs); if (res !== undefined && res.length > 0) { promises.push(...res); } - return promises - } + return promises; + }; this.slicesTbl!.loading = true; Promise.all([result1(), result2(), result3()]).then(res => { @@ -177,7 +177,7 @@ export class TabPaneSlices extends BaseElement { processSlicesResultMap.set(processSliceItem.name, {//@ts-ignore ...processSliceItem, //@ts-ignore tabTitle: processSliceItem.name - }) + }); } } let processSlicesResultsValue = [...processSlicesResultMap.values()]; @@ -189,7 +189,8 @@ export class TabPaneSlices extends BaseElement { count.wallDuration = parseFloat((sumWall / 1000000.0).toFixed(5)); count.occurrences = sumOcc; count.tabTitle = 'Summary'; - count.allName = processSlicesResultsValue.map((item: any) => item.name); + // @ts-ignore + count.allName = processSlicesResultsValue.map((item: unknown) => item.name); processSlicesResultsValue.splice(0, 0, count); //@ts-ignore this.slicesSource = processSlicesResultsValue; this.slicesTbl!.recycleDataSource = processSlicesResultsValue; diff --git a/ide/src/trace/database/TabPaneFreqUsageWorker.ts b/ide/src/trace/database/TabPaneFreqUsageWorker.ts index fc79b946..bd292559 100644 --- a/ide/src/trace/database/TabPaneFreqUsageWorker.ts +++ b/ide/src/trace/database/TabPaneFreqUsageWorker.ts @@ -38,7 +38,7 @@ function orgnazitionMap( let sum: number = 0; // 循环分组 for (let i = 0; i < args.runData.length; i++) { - let mapKey: string = args.runData[i].pid + "_" + args.runData[i].tid; + let mapKey: string = args.runData[i].pid + '_' + args.runData[i].tid; // 该running数据若在map对象中不包含其'pid_tid'构成的键,则新加key-value值 if (!result.has(mapKey)) { result.set(mapKey, new Array()); @@ -172,10 +172,11 @@ function returnObj( const FREQ_MUTIPLE: number = 1000; //@ts-ignore const computorPower: number = comPower ? comPower.get(item.cpu)?.mapData.get(cpuFreqData.value)! : 0; + let result; switch (flag) { case 1: - return { - thread: item.pid + "_" + item.tid, + result = { + thread: item.pid + '_' + item.tid, consumption: cpuFreqData.value * item.dur, cpu: item.cpu, frequency: computorPower ? cpuFreqData.value / FREQ_MUTIPLE + ': ' + computorPower : cpuFreqData.value / FREQ_MUTIPLE, @@ -185,8 +186,8 @@ function returnObj( cpuload: (computorPower * item.dur) / (timeZones * maxCommpuPower) * PERCENT }; case 2: - return { - thread: item.pid + "_" + item.tid, + result = { + thread: item.pid + '_' + item.tid, consumption: cpuFreqData.value * (cpuFreqData.ts + cpuFreqData.dur - item.ts), cpu: item.cpu, frequency: computorPower ? cpuFreqData.value / FREQ_MUTIPLE + ': ' + computorPower : cpuFreqData.value / FREQ_MUTIPLE, @@ -196,8 +197,8 @@ function returnObj( cpuload: (computorPower * (cpuFreqData.ts + cpuFreqData.dur - item.ts)) / (timeZones * maxCommpuPower) * PERCENT }; case 3: - return { - thread: item.pid + "_" + item.tid, + result = { + thread: item.pid + '_' + item.tid, consumption: cpuFreqData.value * (item.dur + item.ts - cpuFreqData.ts), cpu: item.cpu, frequency: computorPower ? cpuFreqData.value / FREQ_MUTIPLE + ': ' + computorPower : cpuFreqData.value / FREQ_MUTIPLE, @@ -207,8 +208,8 @@ function returnObj( cpuload: (computorPower * (item.dur + item.ts - cpuFreqData.ts)) / (timeZones * maxCommpuPower) * PERCENT }; case 4: - return { - thread: item.pid + "_" + item.tid, + result = { + thread: item.pid + '_' + item.tid, consumption: cpuFreqData.value * cpuFreqData.dur, cpu: item.cpu, frequency: computorPower ? cpuFreqData.value / FREQ_MUTIPLE + ': ' + computorPower : cpuFreqData.value / FREQ_MUTIPLE, @@ -218,17 +219,18 @@ function returnObj( cpuload: (computorPower * cpuFreqData.dur) / (timeZones * maxCommpuPower) * PERCENT }; case 5: - return { - thread: item.pid + "_" + item.tid, + result = { + thread: item.pid + '_' + item.tid, consumption: 0, cpu: item.cpu, - frequency: "unknown", + frequency: 'unknown', dur: item.dur, percent: (item.dur / sum) * PERCENT, consumpower: 0, cpuload: 0 }; } + return result; } /** @@ -304,7 +306,7 @@ function dealTree( process.consumption += thread.consumption; process.consumpower += thread.consumpower; process.cpuload += thread.cpuload; - process.thread = process.thread! + key.split("_")[0]; + process.thread = process.thread! + key.split('_')[0]; result.push(process); }); for (let i = 0; i < result.length; i++) { @@ -331,7 +333,7 @@ function dealTree( */ function creatNewObj(cpu: number, flag: boolean = true): RunningFreqData { return { - thread: flag ? "" : "P", + thread: flag ? '' : 'P', consumption: 0, cpu: cpu, frequency: -1, @@ -354,9 +356,9 @@ function fixTotal(arr: Array): Array { // 数据入参的情况是,第一条为进程数据,其后是该进程下所有线程的数据。以进程数据做分割 for (let i = 0; i < arr.length; i++) { // 判断如果是进程数据,则将其children的数组清空,并以其作为最顶层数据 - if (arr[i].thread?.indexOf("P") !== -1) { + if (arr[i].thread?.indexOf('P') !== -1) { arr[i].children = []; - arr[i].thread = arr[i].thread + "-summary data"; + arr[i].thread = arr[i].thread + '-summary data'; result.push(arr[i]); // 标志判定当前数组的长度,也可用.length判断 flag++; @@ -364,7 +366,7 @@ function fixTotal(arr: Array): Array { // 非进程数据会进入到else中,去判断当前线程数据的cpu分组是否存在,不存在则进行创建 if (result[flag].children![arr[i].cpu] === undefined) { result[flag].children![arr[i].cpu] = { - thread: "summary data", + thread: 'summary data', consumption: 0, cpu: arr[i].cpu, frequency: -1, @@ -387,7 +389,7 @@ function fixTotal(arr: Array): Array { ].children?.findIndex((item) => item.frequency === arr[i].frequency)!; // 若存在相同频点的数据,则进行合并,不同直接push if (index === -1) { - arr[i].thread = "summary data"; + arr[i].thread = 'summary data'; result[flag].children![arr[i].cpu].children?.push(arr[i]); } else { result[flag].children![arr[i].cpu].children![index].consumption += arr[i].consumption; @@ -414,29 +416,29 @@ function mergeTotal( const num: number = arr2.findIndex((item) => item.thread?.includes(arr1[i].thread!) ); - arr2[num].thread = "summary data"; + arr2[num].thread = 'summary data'; arr1[i].children?.unshift(arr2[num]); arr2.splice(num, 1); } } - /** - * - * @param arr 待整理的数组,会经过递归取到最底层的数据 - */ +/** + * + * @param arr 待整理的数组,会经过递归取到最底层的数据 + */ function recursion(arr: Array): void { - for (let idx = 0; idx < arr.length; idx++) { - if (arr[idx].cpu === -1) { - resultArray.push(arr[idx]); - } - if (arr[idx].children) { - recursion(arr[idx].children!); - } else { - resultArray.push(arr[idx]); - } + for (let idx = 0; idx < arr.length; idx++) { + if (arr[idx].cpu === -1) { + resultArray.push(arr[idx]); + } + if (arr[idx].children) { + recursion(arr[idx].children!); + } else { + resultArray.push(arr[idx]); } } +} self.onmessage = (e: MessageEvent): void => { comPower = e.data.comPower; diff --git a/ide/src/trace/database/logic-worker/ProcedureLogicWorkerNativeNemory.ts b/ide/src/trace/database/logic-worker/ProcedureLogicWorkerNativeNemory.ts index 2891b95c..71c10c45 100644 --- a/ide/src/trace/database/logic-worker/ProcedureLogicWorkerNativeNemory.ts +++ b/ide/src/trace/database/logic-worker/ProcedureLogicWorkerNativeNemory.ts @@ -1125,7 +1125,7 @@ export class ProcedureLogicWorkerNativeMemory extends LogicHandler { let node: NativeHookCallInfo; if ( //@ts-ignore - currentNode.children.filter((child: NativeHookCallInfo): boolean => { + currentNode.initChildren.filter((child: NativeHookCallInfo): boolean => { if ( child.symbolId === callChainDataList[index]?.symbolId && child.fileId === callChainDataList[index]?.fileId @@ -1140,7 +1140,7 @@ export class ProcedureLogicWorkerNativeMemory extends LogicHandler { node = new NativeHookCallInfo(); this.mergeCallChainSample(node, callChainDataList[index], sample); currentNode.children.push(node); - // currentNode.initChildren.push(node); + currentNode.initChildren.push(node); // 将所有节点存到this.currentTreeList this.currentTreeList.push(node); node.parentNode = currentNode; diff --git a/ide/src/trace/database/logic-worker/ProcedureLogicWorkerSchedulingAnalysis.ts b/ide/src/trace/database/logic-worker/ProcedureLogicWorkerSchedulingAnalysis.ts index 62959946..2944bd58 100644 --- a/ide/src/trace/database/logic-worker/ProcedureLogicWorkerSchedulingAnalysis.ts +++ b/ide/src/trace/database/logic-worker/ProcedureLogicWorkerSchedulingAnalysis.ts @@ -577,7 +577,7 @@ where cpu not null order by cpu,ts;`; this.queryData(this.currentEventId, 'scheduling-Thread Freq', sql, {}); } - queryProTop10Swicount() { + queryProTop10Swicount(): void { this.queryData( this.currentEventId, 'scheduling-Process Top10Swicount', @@ -597,7 +597,7 @@ where cpu not null {} ); } - queryThrTop10Swicount(pid: number) { + queryThrTop10Swicount(pid: number): void { this.queryData( this.currentEventId, 'scheduling-Process Top10Swicount', @@ -618,7 +618,7 @@ where cpu not null {} ); } - queryProTop10RunTime() { + queryProTop10RunTime(): void { this.queryData( this.currentEventId, 'scheduling-Process Top10RunTime', @@ -637,7 +637,7 @@ where cpu not null {} ); } - queryThrTop10RunTime(pid: number) { + queryThrTop10RunTime(pid: number): void { this.queryData( this.currentEventId, 'scheduling-Process Top10RunTime', diff --git a/ide/src/trace/database/sql/Func.sql.ts b/ide/src/trace/database/sql/Func.sql.ts index b375d1db..cb1f230f 100644 --- a/ide/src/trace/database/sql/Func.sql.ts +++ b/ide/src/trace/database/sql/Func.sql.ts @@ -322,8 +322,8 @@ export const getTabSlicesAsyncFunc = ( rightNS: number ): //@ts-ignore Promise> => { - let condition = `${asyncTid !== null && asyncTid !== undefined ? `and A.tid = ${asyncTid}` : ''}`; - let sql = ` + let condition = `${asyncTid !== null && asyncTid !== undefined ? `and A.tid = ${asyncTid}` : ''}`; + let sql = ` SELECT c.name AS name, sum( c.dur ) AS wallDuration, @@ -340,14 +340,14 @@ export const getTabSlicesAsyncFunc = ( and P.pid = ${asyncPid} and - c.name in (${asyncNames.map((it) => "\"" + it + "\"").join(',')}) + c.name in (${asyncNames.map((it) => '\"' + it + '\"').join(',')}) and not ((C.ts - D.start_ts + C.dur < ${leftNS}) or (C.ts - D.start_ts > ${rightNS})) ${condition} group by c.name order by wallDuration desc;`; - return query('getTabSlicesAsyncFunc', sql, {}); + return query('getTabSlicesAsyncFunc', sql, {}); } export const getTabDetails = ( @@ -355,16 +355,16 @@ export const getTabDetails = ( asyncPid: Array, funTids: Array, leftNS: number, - rightNS: number + rightNS: number ): //@ts-ignore Promise> => { - let condition = ` + let condition = ` and A.tid in (${funTids!.join(',')}) and c.cookie is null ${`and P.pid in (${asyncPid.join(',')})`} - ${`and c.name in (${asyncNames.map((it) => "\"" + it + "\"").join(',')})`} - ` - let sql = ` + ${`and c.name in (${asyncNames.map((it) => '\"' + it + '\"').join(',')})`} + `; + let sql = ` SELECT c.name AS name, c.dur AS duration, @@ -383,9 +383,9 @@ export const getTabDetails = ( c.dur >= -1 and not ((C.ts - D.start_ts + C.dur < ${leftNS}) or (C.ts - D.start_ts > ${rightNS})) ${condition} - ` - return query('getTabDetails', sql, {}); - } + `; + return query('getTabDetails', sql, {}); +}; export const getSfDetails = ( asyncNames: Array, asyncPid: number, @@ -394,13 +394,13 @@ export const getSfDetails = ( rightNS: number ): //@ts-ignore Promise> => { - let condition = ` + let condition = ` and c.parent_id not null ${asyncTid !== null && asyncTid !== undefined ? `and A.tid = ${asyncTid}` : ''} ${`and P.pid = ${asyncPid}`} - ${`and c.name in (${asyncNames.map((it) => "\"" + it + "\"").join(',')})`} - ` - let sql = ` + ${`and c.name in (${asyncNames.map((it) => '\"' + it + '\"').join(',')})`} + `; + let sql = ` SELECT c.name AS name, c.dur AS duration, @@ -420,18 +420,18 @@ export const getSfDetails = ( c.dur >= -1 and not ((C.ts - D.start_ts + C.dur < ${leftNS}) or (C.ts - D.start_ts > ${rightNS})) ${condition} - ` - return query('getSfDetails', sql, {}); - } - export const getGhDetails = ( - asyncNames: Array, - catName: string, - asyncPid: number, - leftNS: number, - rightNS: number - ): //@ts-ignore - Promise> => { - let sql = ` + `; + return query('getSfDetails', sql, {}); +}; +export const getGhDetails = ( + asyncNames: Array, + catName: string, + asyncPid: number, + leftNS: number, + rightNS: number +): //@ts-ignore + Promise> => { + let sql = ` SELECT c.name AS name, c.dur AS duration, @@ -459,21 +459,21 @@ export const getSfDetails = ( and cat = '${catName}' and - c.name in (${asyncNames.map((it) => "\"" + it + "\"").join(',')}) + c.name in (${asyncNames.map((it) => '\"' + it + '\"').join(',')}) and not ((C.ts - D.start_ts + C.dur < ${leftNS}) or (C.ts - D.start_ts > ${rightNS})) - ` - return query('getGhDetails', sql, {}); - } + `; + return query('getGhDetails', sql, {}); +}; export const getTabSlicesAsyncCatFunc = ( asyncCatNames: string, asyncCatPid: number, leftNS: number, rightNS: number ): Promise> => -query( - 'getTabSlicesAsyncCatFunc', - ` + query( + 'getTabSlicesAsyncCatFunc', + ` select c.name as name, sum(c.dur) as wallDuration, @@ -502,7 +502,7 @@ query( c.name order by wallDuration desc;`, - { $leftNS: leftNS, $rightNS: rightNS } + { $leftNS: leftNS, $rightNS: rightNS } ); export const querySearchFunc = (search: string): Promise> => diff --git a/ide/src/trace/database/sql/Memory.sql.ts b/ide/src/trace/database/sql/Memory.sql.ts index 2ceb95e1..c1e30912 100644 --- a/ide/src/trace/database/sql/Memory.sql.ts +++ b/ide/src/trace/database/sql/Memory.sql.ts @@ -141,7 +141,7 @@ export const getTabVirtualMemoryType = (startTime: number, endTime: number): Pro ); export const queryNativeMemoryRealTime = (): //@ts-ignore -Promise> => + Promise> => query( 'queryNativeMemoryRealTime', `select cs.ts,cs.clock_name from datasource_clockid dc @@ -152,13 +152,13 @@ Promise> => ); export const queryJsMemoryData = (): //@ts-ignore -Promise> => query('queryJsMemoryData', - 'SELECT 1 WHERE EXISTS(SELECT 1 FROM js_heap_nodes)'); + Promise> => query('queryJsMemoryData', + 'SELECT 1 WHERE EXISTS(SELECT 1 FROM js_heap_nodes)'); export const queryVmTrackerShmData = ( iPid: number ): //@ts-ignore -Promise> => + Promise> => query( 'queryVmTrackerShmData', `SELECT (A.ts - B.start_ts) as startNs, @@ -177,7 +177,7 @@ export const queryVmTrackerShmSelectionData = ( startNs: number, ipid: number ): //@ts-ignore -Promise> => + Promise> => query( 'queryVmTrackerShmSelectionData', `SELECT (A.ts - B.start_ts) as startNS,A.ipid, @@ -198,7 +198,7 @@ export const queryMemoryConfig = async (): Promise> => { {}, ); //@ts-ignore - let keySql = keyList && keyList.length > 0 && keyList.some(entry => entry.key === 'ipid') ? "AND key = 'ipid'" : ""; + let keySql = keyList && keyList.length > 0 && keyList.some(entry => entry.key === 'ipid') ? "AND key = 'ipid'" : ''; return query( 'queryMemoryConfiig', `SELECT ipid as iPid, process.pid AS pid, @@ -215,14 +215,14 @@ export const queryMemoryConfig = async (): Promise> => { ${keySql} ;` ); -} +}; // VM Tracker Purgeable泳道图 export const queryPurgeableProcessData = ( ipid: number, isPin?: boolean ): //@ts-ignore -Promise> => { + Promise> => { const pinSql = isPin ? ' AND a.ref_count > 0' : ''; const names = isPin ? " ('mem.purg_pin')" : "('mem.purg_sum')"; return query( @@ -259,7 +259,7 @@ Promise> => { }; export const queryVirtualMemory = (): //@ts-ignore -Promise> => + Promise> => query('queryVirtualMemory', `select id, @@ -269,7 +269,7 @@ Promise> => export const queryVirtualMemoryData = ( filterId: number ): //@ts-ignore -Promise> => + Promise> => query( 'queryVirtualMemoryData', `select ts-${window.recordStartNS} as startTime,value,filter_id as filterID @@ -375,7 +375,7 @@ export const queryTraceMemoryUnAgg = (): Promise< export const queryMemoryMaxData = ( memoryName: string ): //@ts-ignore -Promise> => + Promise> => query( 'queryMemoryMaxData', `SELECT ifnull(max(m.value),0) as maxValue, @@ -391,7 +391,7 @@ export const getTabPaneVirtualMemoryStatisticsData = ( leftNs: number, rightNs: number ): //@ts-ignore -Promise> => + Promise> => query( 'getTabPaneVirtualMemoryStatisticsData', ` @@ -418,7 +418,7 @@ Promise> => ); export const getFileSysVirtualMemoryChartData = (): //@ts-ignore -Promise> => + Promise> => query( 'getFileSysVirtualMemoryChartData', ` @@ -433,7 +433,7 @@ Promise> => ); export const hasFileSysData = (): //@ts-ignore -Promise> => + Promise> => query( 'hasFileSysData', ` @@ -453,7 +453,7 @@ export const queryEbpfSamplesCount = ( endTime: number, ipids: number[] ): //@ts-ignore -Promise> => + Promise> => query( 'queryEbpfSamplesCount', ` @@ -462,21 +462,19 @@ Promise> => vmCount from (select count(1) as fsCount from file_system_sample s,trace_range t - where s.end_ts between $startTime + t.start_ts and $endTime + t.start_ts ${ - ipids.length > 0 ? `and s.ipid in (${ipids.join(',')})` : '' -}) + where s.end_ts between $startTime + t.start_ts and $endTime + t.start_ts ${ipids.length > 0 ? `and s.ipid in (${ipids.join(',')})` : '' + }) ,(select count(1) as vmCount from paged_memory_sample s,trace_range t -where s.end_ts between $startTime + t.start_ts and $endTime + t.start_ts ${ - ipids.length > 0 ? `and s.ipid in (${ipids.join(',')})` : '' -}); +where s.end_ts between $startTime + t.start_ts and $endTime + t.start_ts ${ipids.length > 0 ? `and s.ipid in (${ipids.join(',')})` : '' + }); `, - { $startTime: startTime, $endTime: endTime } -); + { $startTime: startTime, $endTime: endTime } + ); export const queryisExistsShmData = ( iPid: number ): //@ts-ignore -Promise> => + Promise> => query( 'queryisExistsShmData', `SELECT EXISTS ( @@ -496,7 +494,7 @@ export const queryVmTrackerShmSizeData = ( iPid: number, dur: number ): //@ts-ignore -Promise> => + Promise> => query( 'queryVmTrackerShmSizeData', `SELECT ( A.ts - B.start_ts ) AS startNS, @@ -518,7 +516,7 @@ export const queryisExistsPurgeableData = ( ipid: number, isPin?: boolean ): //@ts-ignore -Promise> => { + Promise> => { const pinSql = isPin ? ' AND a.ref_count > 0' : ''; const names = isPin ? " ('mem.purg_pin')" : "('mem.purg_sum')"; return query( diff --git a/ide/src/trace/database/sql/ProcessThread.sql.ts b/ide/src/trace/database/sql/ProcessThread.sql.ts index c2486a63..e642a44c 100644 --- a/ide/src/trace/database/sql/ProcessThread.sql.ts +++ b/ide/src/trace/database/sql/ProcessThread.sql.ts @@ -329,12 +329,13 @@ where B.tid = $tid and B.pid = $pid;`, { $tid: tid, $pid: pid } ); - export const queryThreadWakeUpFrom = async (itid: number, startTime: number): Promise => { - let sql1 = `select wakeup_from from instant where ts = ${startTime} and ref = ${itid} limit 1`; - const result = await query('queryThreadWakeUpFrom', sql1, {}, { traceId: Utils.currentSelectTrace }); - if (result && result.length > 0) { //@ts-ignore - let wakeupFromItid = result[0].wakeup_from; // 获取wakeup_from的值 - let sql2 = ` +export const queryThreadWakeUpFrom = async (itid: number, startTime: number): Promise => { + let sql1 = `select wakeup_from from instant where ts = ${startTime} and ref = ${itid} limit 1`; + const result = await query('queryThreadWakeUpFrom', sql1, {}, { traceId: Utils.currentSelectTrace }); + let res: unknown = []; + if (result && result.length > 0) { //@ts-ignore + let wakeupFromItid = result[0].wakeup_from; // 获取wakeup_from的值 + let sql2 = ` select (A.ts - B.start_ts) as ts, A.tid, A.itid, @@ -347,18 +348,20 @@ where B.tid = $tid and B.pid = $pid;`, and A.itid = ${wakeupFromItid} and (A.ts - B.start_ts) < (${startTime} - B.start_ts) order by ts desc limit 1 - `; - return query('queryThreadWakeUpFrom', sql2, {}, { traceId: Utils.currentSelectTrace }); - } - }; + `; + res = query('queryThreadWakeUpFrom', sql2, {}, { traceId: Utils.currentSelectTrace }); + } + return res +}; export const queryRWakeUpFrom = async (itid: number, startTime: number): Promise => { let sql1 = `select wakeup_from from instant where ts = ${startTime} and ref = ${itid} limit 1`; const res = await query('queryRWakeUpFrom', sql1, {}, { traceId: Utils.currentSelectTrace }); + let result: unknown = []; if (res && res.length) { //@ts-ignore let wakeupFromItid = res[0].wakeup_from; - let sql2 =` + let sql2 = ` select (A.ts - B.start_ts) as ts, A.tid, @@ -375,8 +378,9 @@ export const queryRWakeUpFrom = async (itid: number, startTime: number): Promise ts desc limit 1 `; - return query('queryRWakeUpFrom', sql2, {}, { traceId: Utils.currentSelectTrace }); + result = query('queryRWakeUpFrom', sql2, {}, { traceId: Utils.currentSelectTrace }); } + return result; }; export const queryRunnableTimeByRunning = (tid: number, startTime: number): Promise> => { let sql = ` @@ -783,7 +787,7 @@ export const queryThreadStateArgsByName = (key: string, traceId?: string): { traceId: traceId } ); -export const queryArgsById = (key: string, traceId?: string): +export const queryArgsById = (key: string, traceId?: string): Promise> => query( 'queryArgsById', diff --git a/ide/src/trace/database/ui-worker/ProcedureWorkerFunc.ts b/ide/src/trace/database/ui-worker/ProcedureWorkerFunc.ts index d4f2d27e..78c8a752 100644 --- a/ide/src/trace/database/ui-worker/ProcedureWorkerFunc.ts +++ b/ide/src/trace/database/ui-worker/ProcedureWorkerFunc.ts @@ -96,8 +96,8 @@ export function func( rowParentId: string | null | undefined ): void { if (use && funcFilter.length > 0) { - if (rowParentId === "UserPluginsRows" && !expand) { - funcFilter = funcFilter.filter((it) => it.depth === 0) + if (rowParentId === 'UserPluginsRows' && !expand) { + funcFilter = funcFilter.filter((it) => it.depth === 0); } for (let i = 0, len = funcFilter.length; i < len; i++) { if ((funcFilter[i].startTs || 0) + (funcFilter[i].dur || 0) >= startNS && (funcFilter[i].startTs || 0) <= endNS) { -- Gitee From 6d19f700a695cf66d2810b2cfd5ba3acb0b247e1 Mon Sep 17 00:00:00 2001 From: liufei Date: Tue, 3 Sep 2024 16:03:23 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:20240903=E4=BB=A3=E7=A0=81=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E6=B1=87=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liufei --- ide/src/base-ui/select/LitSelect.ts | 12 +-- ide/src/base-ui/select/LitSelectV.ts | 44 ++++----- ide/src/hdc/hdcclient/HdcClient.ts | 2 +- ide/src/trace/component/SpBubblesAI.ts | 8 +- ide/src/trace/component/SpFlags.ts | 14 +-- .../trace/component/SpSystemTrace.event.ts | 6 +- ide/src/trace/component/SpSystemTrace.init.ts | 16 ++-- ide/src/trace/component/SpSystemTrace.ts | 16 ++-- .../trace/component/chart/SpChartManager.ts | 2 +- .../trace/component/chart/SpFrameTimeChart.ts | 2 +- .../chart/SpImportUserPluginsChart.ts | 51 ++++++----- .../trace/component/chart/SpProcessChart.ts | 11 ++- .../component/chart/SpSegmentationChart.ts | 2 +- .../processAnalysis/TabProcessAnalysis.ts | 2 +- .../Top10LongestRunTimeProcess.ts | 89 +++++++++++-------- .../Top10ProcessSwitchCount.ts | 62 +++++++------ ide/src/trace/component/setting/SpArkTs.ts | 2 +- .../trace/component/setting/SpHilogRecord.ts | 2 +- .../trace/component/setting/SpHisysEvent.ts | 6 +- .../trace/component/setting/SpSdkConfig.ts | 6 +- .../trace/component/setting/SpVmTracker.ts | 2 +- .../trace/component/trace/base/TraceRow.ts | 10 +-- .../trace/sheet/cpu/TabPaneCpuByThread.ts | 6 +- .../trace/sheet/cpu/TabPaneSchedPriority.ts | 2 +- .../trace/sheet/freq/TabPaneCpuFreqLimits.ts | 14 +-- .../trace/sheet/frequsage/TabPaneFreqUsage.ts | 38 ++++---- .../trace/sheet/hiperf/TabPerfBottomUp.ts | 2 +- 27 files changed, 228 insertions(+), 201 deletions(-) diff --git a/ide/src/base-ui/select/LitSelect.ts b/ide/src/base-ui/select/LitSelect.ts index 6f6768be..aad124e5 100644 --- a/ide/src/base-ui/select/LitSelect.ts +++ b/ide/src/base-ui/select/LitSelect.ts @@ -216,12 +216,12 @@ export class LitSelect extends BaseElement { initElements(): void { this.selectVInputEl = this.shadowRoot!.querySelector('#select-input') as HTMLInputElement; - this.selectVInputEl?.addEventListener('keyup', (e) => { - if (e.code === 'Enter' || e.code === 'NumpadEnter') {// @ts-ignore - this.selectVInputEl.blur();// @ts-ignore - this.selectInputEl.value=this.selectVInputEl.value; - } - }); + this.selectVInputEl?.addEventListener('keyup', (e) => { + if (e.code === 'Enter' || e.code === 'NumpadEnter') {// @ts-ignore + this.selectVInputEl.blur();// @ts-ignore + this.selectInputEl.value = this.selectVInputEl.value; + } + }); if (this.showSearchInput) { this.shadowRoot!.querySelector('.body-select')!.style.display = 'block'; this.selectSearchInputEl = this.shadowRoot!.querySelector('#search-input') as HTMLInputElement; diff --git a/ide/src/base-ui/select/LitSelectV.ts b/ide/src/base-ui/select/LitSelectV.ts index 28f3f191..a6d2e5cd 100644 --- a/ide/src/base-ui/select/LitSelectV.ts +++ b/ide/src/base-ui/select/LitSelectV.ts @@ -109,7 +109,7 @@ export class LitSelectV extends BaseElement { return this.hasAttribute('is-all'); } - dataSource(selectVData: Array, valueStr: string,isSingle?:boolean): void { + dataSource(selectVData: Array, valueStr: string, isSingle?: boolean): void { this.selectVOptions!.innerHTML = ''; if (selectVData.length > 0) { this.selectVBody!.style.display = 'block'; @@ -125,14 +125,14 @@ export class LitSelectV extends BaseElement { option.textContent = valueStr; this.selectVOptions!.appendChild(option); this.initDataItem(selectVData); - if(isSingle){ + if (isSingle) { this.initSingleCustomOptions(); } else { this.initCustomOptions(); } } else { this.initDataItem(selectVData); - if(isSingle){ + if (isSingle) { this.initSingleCustomOptions(); } else { this.initOptions(); @@ -171,7 +171,7 @@ export class LitSelectV extends BaseElement { this.selectVInputEl?.addEventListener('keyup', (e) => { if (e.code === 'Enter' || e.code === 'NumpadEnter') {// @ts-ignore this.selectVInputEl.blur(); - } + } });// @ts-ignore this.selectVInputEl!.oninput = (ev: InputEvent): void => { // @ts-ignore @@ -250,7 +250,7 @@ export class LitSelectV extends BaseElement { `; } - connectedCallback(): void {} + connectedCallback(): void { } initCustomOptions(): void { let querySelector = this.shadowRoot?.querySelector( @@ -291,22 +291,22 @@ export class LitSelectV extends BaseElement { } initSingleCustomOptions(): void { - let selectedOption = this.shadowRoot?.querySelector( - `lit-select-option[value="${this.currentvalueStr}"]` - ) as LitSelectOption | null; - if (selectedOption) { - selectedOption.setAttribute('selected', ''); - } - this.shadowRoot?.querySelectorAll('lit-select-option').forEach((option) => { - option.addEventListener('onSelected', () => { - this.shadowRoot?.querySelectorAll('lit-select-option').forEach((o) => { - o.removeAttribute('selected'); - }); - option.setAttribute('selected', ''); // @ts-ignore - this.selectVInputEl!.value = option.textContent!; - this.currentvalueStr = option.textContent!; - }); - }); + let selectedOption = this.shadowRoot?.querySelector( + `lit-select-option[value="${this.currentvalueStr}"]` + ) as LitSelectOption | null; + if (selectedOption) { + selectedOption.setAttribute('selected', ''); + } + this.shadowRoot?.querySelectorAll('lit-select-option').forEach((option) => { + option.addEventListener('onSelected', () => { + this.shadowRoot?.querySelectorAll('lit-select-option').forEach((o) => { + o.removeAttribute('selected'); + }); + option.setAttribute('selected', ''); // @ts-ignore + this.selectVInputEl!.value = option.textContent!; + this.currentvalueStr = option.textContent!; + }); + }); } initOptions(): void { @@ -369,5 +369,5 @@ export class LitSelectV extends BaseElement { }); } - attributeChangedCallback(name: unknown, oldValue: unknown, newValue: unknown): void {} + attributeChangedCallback(name: unknown, oldValue: unknown, newValue: unknown): void { } } diff --git a/ide/src/hdc/hdcclient/HdcClient.ts b/ide/src/hdc/hdcclient/HdcClient.ts index 93c726df..5393d55c 100644 --- a/ide/src/hdc/hdcclient/HdcClient.ts +++ b/ide/src/hdc/hdcclient/HdcClient.ts @@ -77,7 +77,7 @@ export class HdcClient implements DataListener { case AuthType.AUTH_TOKEN: continue; case AuthType.AUTH_SIGNATURE: - const hdcMsgUrl = this.isSigna ? 'signatureHdcMsg' : 'encryptHdcMsg' + const hdcMsgUrl = this.isSigna ? 'signatureHdcMsg' : 'encryptHdcMsg'; const response = await fetch(`${window.location.origin}/application/${hdcMsgUrl}?message=` + returnBuf); const dataBody = await response.json(); let signatureHdcMsg = ''; diff --git a/ide/src/trace/component/SpBubblesAI.ts b/ide/src/trace/component/SpBubblesAI.ts index 9d03886f..addf5fdf 100644 --- a/ide/src/trace/component/SpBubblesAI.ts +++ b/ide/src/trace/component/SpBubblesAI.ts @@ -23,7 +23,7 @@ export class SpBubblesAI extends BaseElement { const xiaoLubanEl: HTMLElement | undefined | null = this.shadowRoot?.querySelector('#xiao-luban-help'); xiaoLubanEl?.addEventListener('click', () => { this.xiaoLubanEvent(); - }) + }); let isShowXiaoLuban: boolean = FlagsConfig.getFlagsConfigEnableStatus('xiaoLuBan'); if (isShowXiaoLuban) { xiaoLubanEl?.setAttribute('enabled', ''); @@ -45,7 +45,7 @@ export class SpBubblesAI extends BaseElement { 'msgType': 'text', 'timestamp': new Date().getTime().toString(), 'botUser': 'p_xiaoluban', - } + }; fetch('https://smartperf.rnd.huawei.com/xiaoluban/resource', { method: 'post', body: JSON.stringify(data), @@ -54,9 +54,9 @@ export class SpBubblesAI extends BaseElement { } }).then(res => { if (res.status === 200) { - window.open('im:p_xiaoluban', "_self"); + window.open('im:p_xiaoluban', '_self'); } - }) + }); } } diff --git a/ide/src/trace/component/SpFlags.ts b/ide/src/trace/component/SpFlags.ts index a8e6cf63..308ee5c2 100644 --- a/ide/src/trace/component/SpFlags.ts +++ b/ide/src/trace/component/SpFlags.ts @@ -18,22 +18,22 @@ import { SpFlagHtml } from './SpFlag.html'; const NUM = '000000'; //vsync二级下拉选框对应的value和content const VSYNC_CONTENT = [ - { value: 'H:VsyncGenerator', content: "VsyncGeneratior" }, + { value: 'H:VsyncGenerator', content: 'VsyncGeneratior' }, { value: 'H:rs_SendVsync', content: 'Vsync-rs' }, { value: 'H:rs_SendVsync', content: 'Vsync-app' } -] +]; //cat二级下拉选框对应的value和content const CAT_CONTENT = [ - { value: 'business', content: "Business first" }, + { value: 'business', content: 'Business first' }, { value: 'thread', content: 'Thread first' } -] +]; //hang二级下拉选框对应的value和content const HANG_CONTENT = [ - { value: `33${NUM}`, content: "Instant" }, + { value: `33${NUM}`, content: 'Instant' }, { value: `100${NUM}`, content: 'Circumstantial' }, { value: `250${NUM}`, content: 'Micro' }, { value: `500${NUM}`, content: 'Severe' } -] +]; //整合默认值 const CONFIG_STATE: unknown = { @@ -214,7 +214,7 @@ export class SpFlags extends BaseElement { } else { userIdInputEl.style.border = '1px solid red'; } - }) + }); userIdInputEl.className = 'device_input'; userIdInputEl.id = 'user_id_input'; configFooterDiv.appendChild(userIdLabelEl); diff --git a/ide/src/trace/component/SpSystemTrace.event.ts b/ide/src/trace/component/SpSystemTrace.event.ts index 0c8ed206..ab442e53 100644 --- a/ide/src/trace/component/SpSystemTrace.event.ts +++ b/ide/src/trace/component/SpSystemTrace.event.ts @@ -619,9 +619,9 @@ export function spSystemTraceDocumentOnKeyPress(this: unknown, sp: SpSystemTrace sp.observerScrollHeightEnable = false; if (sp.keyboardEnable) { if (keyPress === 'm') { - if(sp.selectFlag) { + if (sp.selectFlag) { sp.selectFlag!.selected = false; - } + } sp.slicestime = sp.setSLiceMark(ev.shiftKey); if (sp.slicestime) { if (TraceRow.rangeSelectObject) { @@ -636,7 +636,7 @@ export function spSystemTraceDocumentOnKeyPress(this: unknown, sp: SpSystemTrace } if (keyPress === 'f') { let search = document.querySelector('body > sp-application')!.shadowRoot!.querySelector('#lit-search'); - if(search && search.searchValue !== '' && sp.currentRow !== undefined) { + if (search && search.searchValue !== '' && sp.currentRow !== undefined) { sp.currentRow = undefined; } let isSelectSliceOrFlag = false; diff --git a/ide/src/trace/component/SpSystemTrace.init.ts b/ide/src/trace/component/SpSystemTrace.init.ts index 85b95e18..93f6d623 100644 --- a/ide/src/trace/component/SpSystemTrace.init.ts +++ b/ide/src/trace/component/SpSystemTrace.init.ts @@ -417,9 +417,9 @@ function collectHandlerYes(sp: SpSystemTrace, currentRow: unknown, event: unknow !currentRow.name.includes(parentRow.name) ) { //@ts-ignore - currentRow.name = currentRow.protoParentId ? `${currentRow.name} (${currentRow.protoParentId})` : - //@ts-ignore - `${currentRow.name} (${parentRow.name})` + currentRow.name = currentRow.protoParentId ? `${currentRow.name} (${currentRow.protoParentId})` : + //@ts-ignore + `${currentRow.name} (${parentRow.name})`; } }); } @@ -769,8 +769,8 @@ export function spSystemTraceInitElement(sp: SpSystemTrace): void { } sp.tabCpuFreq = sp.traceSheetEL.shadowRoot.querySelector('tabpane-frequency-sample'); sp.tabCpuState = sp.traceSheetEL.shadowRoot.querySelector('tabpane-counter-sample'); - sp.wakeupListTbl = sp.traceSheetEL.shadowRoot?.querySelector("#current-selection > tabpane-current-selection")?. - shadowRoot?.querySelector("#wakeupListTbl"); + sp.wakeupListTbl = sp.traceSheetEL.shadowRoot?.querySelector('#current-selection > tabpane-current-selection')?. + shadowRoot?.querySelector('#wakeupListTbl'); sp.rangeSelect = new RangeSelect(sp); // @ts-ignore rightButton?.addEventListener('click', rightButtonOnClick(sp, rightStar)); @@ -911,11 +911,12 @@ function spSystemTraceShowStructFindIndex( return findIndex; } //向前查找逻辑 -function findPreviousOne(start: number, end: number, structs: Array): number { +function findPreviousOne(start: number, end: number, structs: Array): number { let findIndex = -1; const rangeEnd = TraceRow.range!.endNS; for (let i = start; i >= end; i--) { let it = structs[i]; + //@ts-ignore if (it.startTime! < rangeEnd) { findIndex = i; break; @@ -924,11 +925,12 @@ function findPreviousOne(start: number, end: number, structs: Array): numbe return findIndex; } //向后查找 -function findNextOne(start: number, end: number, structs: Array): number { +function findNextOne(start: number, end: number, structs: Array): number { let findIndex = -1; const rangeStart = TraceRow.range!.startNS; for (let i = start; i <= end; i++) { let it = structs[i]; + //@ts-ignore if (it.startTime > rangeStart) { findIndex = i; break; diff --git a/ide/src/trace/component/SpSystemTrace.ts b/ide/src/trace/component/SpSystemTrace.ts index 34312c6c..5d1c75c9 100644 --- a/ide/src/trace/component/SpSystemTrace.ts +++ b/ide/src/trace/component/SpSystemTrace.ts @@ -229,9 +229,9 @@ export class SpSystemTrace extends BaseElement { focusTarget: string = ''; wakeupListTbl: LitTable | undefined | null; _checkclick: boolean = false; //判断点击getWakeupList按钮 - docomList: Array = []; + docomList: Array = []; repaintList: Array = []; - presentList: Array = []; + presentList: Array = []; set snapshotFile(data: FileInfo) { this.snapshotFiles = data; @@ -376,18 +376,18 @@ export class SpSystemTrace extends BaseElement { } pushPidToSelection(selection: SelectionParam, id: string, originalId?: string | Array): void { - let add = (it: string) => { + let add = (it: string): void => { let pid = parseInt(it ? it : id); if (!isNaN(pid!)) { if (!selection.processIds.includes(pid!)) { selection.processIds.push(pid!); } } - } + }; if (Array.isArray(originalId)) { originalId.forEach(item => { add(item); - }) + }); } else { add(originalId!); } @@ -1198,7 +1198,7 @@ export class SpSystemTrace extends BaseElement { } this.rangeTraceRow = rows; let search = document.querySelector('body > sp-application')!.shadowRoot!.querySelector('#lit-search'); - if(search?.isClearValue) { + if (search?.isClearValue) { spSystemTraceDocumentOnMouseMoveMouseDown(this, search!); } this.rangeSelect.selectHandler?.(this.rangeSelect.rangeTraceRow, false); @@ -2311,7 +2311,7 @@ export class SpSystemTrace extends BaseElement { showStruct(previous: boolean, currentIndex: number, structs: Array, retargetIndex?: number): number { let tagIndex = spSystemTraceShowStruct(this, previous, currentIndex, structs, retargetIndex); - return tagIndex === -1?currentIndex:tagIndex; + return tagIndex === -1 ? currentIndex : tagIndex; } private toTargetDepth = (entry: unknown, funcRowID: string, funcStract: unknown): void => { @@ -2640,7 +2640,7 @@ export class SpSystemTrace extends BaseElement { window.publish(window.SmartEvent.UI.WakeupList, SpSystemTrace.wakeupList); this.wakeupListTbl!.loading = false; this._checkclick = false; - this.refreshCanvas(true); + this.refreshCanvas(true); return null; } // @ts-ignore SpSystemTrace.wakeupList.push(a); // @ts-ignore diff --git a/ide/src/trace/component/chart/SpChartManager.ts b/ide/src/trace/component/chart/SpChartManager.ts index 68a962fd..a852490e 100644 --- a/ide/src/trace/component/chart/SpChartManager.ts +++ b/ide/src/trace/component/chart/SpChartManager.ts @@ -58,7 +58,7 @@ import { sliceSender } from '../../database/data-trafic/SliceSender'; import { BaseStruct } from '../../bean/BaseStruct'; import { SpGpuCounterChart } from './SpGpuCounterChart'; import { SpUserFileChart } from './SpUserPluginChart'; -import { SpImportUserPluginsChart } from './SpImportUserPluginsChart' +import { SpImportUserPluginsChart } from './SpImportUserPluginsChart'; import { queryDmaFenceIdAndCat } from '../../database/sql/dmaFence.sql'; import { queryAllFuncNames } from '../../database/sql/Func.sql'; diff --git a/ide/src/trace/component/chart/SpFrameTimeChart.ts b/ide/src/trace/component/chart/SpFrameTimeChart.ts index 30c95421..7f1b0b76 100644 --- a/ide/src/trace/component/chart/SpFrameTimeChart.ts +++ b/ide/src/trace/component/chart/SpFrameTimeChart.ts @@ -246,7 +246,7 @@ export class SpFrameTimeChart { this.flagConfig = FlagsConfig.getFlagsConfig('AnimationAnalysis'); let appNameMap: Map = new Map(); //@ts-ignore - if (this.flagConfig?.AnimationAnalysis === 'Enabled' && sourceTypeName[0].value !== "txt-based-trace") { + if (this.flagConfig?.AnimationAnalysis === 'Enabled' && sourceTypeName[0].value !== 'txt-based-trace') { if (process.processName?.startsWith('render_service')) { let targetRowList = processRow.childrenList.filter( (childRow) => childRow.rowType === 'thread' && childRow.name.startsWith('render_service') diff --git a/ide/src/trace/component/chart/SpImportUserPluginsChart.ts b/ide/src/trace/component/chart/SpImportUserPluginsChart.ts index de06578d..3baccaff 100644 --- a/ide/src/trace/component/chart/SpImportUserPluginsChart.ts +++ b/ide/src/trace/component/chart/SpImportUserPluginsChart.ts @@ -25,6 +25,7 @@ import { ProcessMemStruct } from '../../bean/ProcessMemStruct'; import { MemRender } from '../../database/ui-worker/ProcedureWorkerMem'; import { FuncRender, FuncStruct } from '../../database/ui-worker/ProcedureWorkerFunc'; import { ThreadRender } from '../../database/ui-worker/ProcedureWorkerThread'; +import { promises } from 'dns'; const FOLD_HEIGHT = 24; export class SpImportUserPluginsChart { private trace: SpSystemTrace; @@ -35,7 +36,7 @@ export class SpImportUserPluginsChart { this.trace = trace; } - async init(traceId?: string) { + async init(traceId?: string): Promise { this.traceId = traceId; //@ts-ignore let folderRow = this.createFolderRow(this.traceId); @@ -66,7 +67,7 @@ export class SpImportUserPluginsChart { * @param row * @param start_ts */ - addTraceRowEventListener(row: TraceRow) { + addTraceRowEventListener(row: TraceRow): void { row.uploadEl?.addEventListener('sample-file-change', (e: unknown) => { this.getJsonData(e).then((res: unknown) => { if (row.childrenList.length) { this.handleDynamicRowList(row); } @@ -104,17 +105,17 @@ export class SpImportUserPluginsChart { this.addDrawAttributes(item, childRow, element); row.summaryProtoPid!.push(childRow.protoPid); row.addChildTraceRow(childRow); - } - } - }) + }; + }; + }); row.expansion = true; - } - this.trace.refreshCanvas(false) - }) - }) + }; + this.trace.refreshCanvas(false); + }); + }); } //清空row-parent-id='UserPluginsRows'动态添加的子Row的list数据 - handleDynamicRowList(row: TraceRow) { + handleDynamicRowList(row: TraceRow): void { row.summaryProtoPid = []; // 使用querySelectorAll找到所有row-parent-id='UserPluginsRows'的div元素 //@ts-ignore @@ -135,21 +136,23 @@ export class SpImportUserPluginsChart { row.childrenList = []; } - addDrawAttributes(item: { rowType: string, threadName: string }, childRow: TraceRow, element: unknown) { + addDrawAttributes(item: { rowType: string, threadName: string }, childRow: TraceRow, element: unknown): void { //@ts-ignore if (element.supplier) { - childRow.supplier = async () => { + //@ts-ignore + childRow.supplier = async (): Promise => { //@ts-ignore let res = await element.supplier!(); - return res - } + return res; + }; //@ts-ignore } else if (element.supplierFrame) { - childRow.supplierFrame = async () => { + //@ts-ignore + childRow.supplierFrame = async (): Promise => { //@ts-ignore let res = await element.supplierFrame!(); - return res - } + return res; + }; } if (item.rowType === TraceRow.ROW_TYPE_MEM) {//处理mem childRow.findHoverStruct = (): void => { @@ -180,10 +183,10 @@ export class SpImportUserPluginsChart { } //@ts-ignore if (element.asyncFuncThreadName) { - //@ts-ignore - childRow.asyncFuncThreadName = element.asyncFuncThreadName; //@ts-ignore - childRow.asyncFuncNamePID = element.asyncFuncNamePID; + childRow.asyncFuncThreadName = element.asyncFuncThreadName; + //@ts-ignore + childRow.asyncFuncNamePID = element.asyncFuncNamePID; } childRow.findHoverStruct = (): void => { //@ts-ignore @@ -206,14 +209,14 @@ export class SpImportUserPluginsChart { let reader = new FileReader(); //@ts-ignore reader.readAsText(file.detail || file); - reader.onloadend = (e: unknown) => { + reader.onloadend = (e: unknown): void => { //@ts-ignore const fileContent = e.target?.result; try { resolve(JSON.parse(fileContent)); document.dispatchEvent( new CustomEvent('file-correct') - ) + ); SpStatisticsHttpUtil.addOrdinaryVisitAction({ event: 'seach-row', action: 'seach-row', @@ -221,10 +224,10 @@ export class SpImportUserPluginsChart { } catch (error) { document.dispatchEvent( new CustomEvent('file-error') - ) + ); } } - }) + }); } } export const folderThreadHandler = (row: TraceRow, trace: SpSystemTrace) => { diff --git a/ide/src/trace/component/chart/SpProcessChart.ts b/ide/src/trace/component/chart/SpProcessChart.ts index af5b0d19..4ac0f5cc 100644 --- a/ide/src/trace/component/chart/SpProcessChart.ts +++ b/ide/src/trace/component/chart/SpProcessChart.ts @@ -1383,17 +1383,20 @@ export class SpProcessChart { ({ setArrayLenThanOne, setArrayLenOnlyOne } = this.hanldAsyncFunc(it, asyncRemoveCatArr));//len等于0和大于0的分类 //@ts-ignore let aggregateData = {...setArrayLenThanOne, ...setArrayLenOnlyOne }; - Reflect.ownKeys(aggregateData).map((key: any) => { - let param: Array = aggregateData[key]; + Reflect.ownKeys(aggregateData).map((key: unknown) => { + let param: Array = aggregateData[key]; + //@ts-ignore this.makeAddAsyncFunction(param, it, processRow, key); }) //@ts-ignore - Reflect.ownKeys(asyncCat).map((key: any) => { + Reflect.ownKeys(asyncCat).map((key: unknown) => { //@ts-ignore - let param: Array = asyncCat[key]; + let param: Array = asyncCat[key]; if (flag) {//处理business + //@ts-ignore this.makeAddAsyncFunction(param, it, processRow, key); } else {//处理thread + //@ts-ignore this.makeAddAsyncFunction(param, it, processRow, key, param[0].tid); } }) diff --git a/ide/src/trace/component/chart/SpSegmentationChart.ts b/ide/src/trace/component/chart/SpSegmentationChart.ts index 0fecf881..430d7bf5 100644 --- a/ide/src/trace/component/chart/SpSegmentationChart.ts +++ b/ide/src/trace/component/chart/SpSegmentationChart.ts @@ -24,7 +24,7 @@ import { type AllStatesRender, AllstatesStruct } from '../../database/ui-worker/ import { StateGroup } from '../../bean/StateModle'; import { queryAllFuncNames } from '../../database/sql/Func.sql'; import { Utils } from '../trace/base/Utils'; -import { TabPaneFreqUsage } from "../trace/sheet/frequsage/TabPaneFreqUsage"; +import { TabPaneFreqUsage } from '../trace/sheet/frequsage/TabPaneFreqUsage'; const UNIT_HEIGHT: number = 20; const MS_TO_US: number = 1000000; const MIN_HEIGHT: number = 2; diff --git a/ide/src/trace/component/schedulingAnalysis/processAnalysis/TabProcessAnalysis.ts b/ide/src/trace/component/schedulingAnalysis/processAnalysis/TabProcessAnalysis.ts index 5624ce82..4cf79f33 100644 --- a/ide/src/trace/component/schedulingAnalysis/processAnalysis/TabProcessAnalysis.ts +++ b/ide/src/trace/component/schedulingAnalysis/processAnalysis/TabProcessAnalysis.ts @@ -20,7 +20,7 @@ import './Top10ProcessSwitchCount.ts'; import { Top10LongestRunTimeProcess } from './Top10LongestRunTimeProcess'; import { Top10ProcessSwitchCount } from './Top10ProcessSwitchCount'; -@element("tab-process-analysis") +@element('tab-process-analysis') export class TabProcessAnalysis extends BaseElement { private currentTabID: string | undefined; private currentTab: BaseElement | undefined; diff --git a/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10LongestRunTimeProcess.ts b/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10LongestRunTimeProcess.ts index 38d16873..77da6c9e 100644 --- a/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10LongestRunTimeProcess.ts +++ b/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10LongestRunTimeProcess.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { BaseElement, element } from "../../../../base-ui/BaseElement"; +import { BaseElement, element } from '../../../../base-ui/BaseElement'; import { LitTable } from '../../../../base-ui/table/lit-table'; import { procedurePool } from '../../../database/Procedure'; import { info } from '../../../../log/Log'; @@ -25,7 +25,7 @@ import { LitChartColumn } from '../../../../base-ui/chart/column/LitChartColumn' import '../../../../base-ui/chart/column/LitChartColumn'; import { Utils } from '../../trace/base/Utils'; -@element("top10-longest-runtime-process") +@element('top10-longest-runtime-process') export class Top10LongestRunTimeProcess extends BaseElement { traceChange: boolean = false; private processRunTimeTbl: LitTable | null | undefined; @@ -48,7 +48,7 @@ export class Top10LongestRunTimeProcess extends BaseElement { /** * 初始化操作,若trace发生改变,将所有变量设置为默认值并重新请求数据。若trace未改变,跳出初始化 */ - init() { + init(): void { if (!this.traceChange) { if (this.processRunTimeTbl!.recycleDataSource.length > 0) { this.processRunTimeTbl?.reMeauseHeight(); @@ -63,16 +63,16 @@ export class Top10LongestRunTimeProcess extends BaseElement { this.processMap = Utils.getInstance().getProcessMap(); this.threadMap = Utils.getInstance().getThreadMap(); this.queryLogicWorker( - "scheduling-Process Top10RunTime", - "query Process Top10 Run Time Analysis Time:", + 'scheduling-Process Top10RunTime', + 'query Process Top10 Run Time Analysis Time:', this.callBack.bind(this) ); } - + /** * 清除已存储数据 */ - clearData() { + clearData(): void { this.traceChange = true; this.processSwitchCountChart!.dataSource = []; this.processRunTimeTbl!.recycleDataSource = []; @@ -93,7 +93,7 @@ export class Top10LongestRunTimeProcess extends BaseElement { */ queryLogicWorker(option: string, log: string, handler: (res: Array) => void, pid?: number): void { let processThreadCountTime = new Date().getTime(); - procedurePool.submitWithName('logic0', option, {pid: pid}, undefined, handler); + procedurePool.submitWithName('logic0', option, { pid: pid }, undefined, handler); let durTime = new Date().getTime() - processThreadCountTime; info(log, durTime); } @@ -111,8 +111,8 @@ export class Top10LongestRunTimeProcess extends BaseElement { const pStr: string | null = this.processMap.get(arr[i].pid!)!; const tStr: string | null = this.threadMap.get(arr[i].tid!)!; result.push({ - NO: i + 1, - pid: arr[i].pid || this.processId, + NO: i + 1, + pid: arr[i].pid || this.processId, pName: pStr === null ? 'Process ' : pStr, dur: arr[i].dur, tid: arr[i].tid, @@ -151,28 +151,28 @@ export class Top10LongestRunTimeProcess extends BaseElement { xField: 'pid', yField: 'dur', seriesField: 'size', - color: (a) => { - return '#0a59f7'; + color: (a): string => { + return '#0a59f7'; }, - hoverHandler: (data) => { + hoverHandler: (data): void => { if (data) { this.processRunTimeTbl!.setCurrentHover(data); } else { this.processRunTimeTbl!.mouseOut(); } }, - tip: (obj) => { + tip: (obj): string => { return `
Process_Id:${ - // @ts-ignore - obj[0].obj.pid}
+ // @ts-ignore + obj[0].obj.pid}
Process_Name:${ - // @ts-ignore - obj[0].obj.pName}
+ // @ts-ignore + obj[0].obj.pName}
Run_Time:${ - // @ts-ignore - obj[0].obj.dur}
+ // @ts-ignore + obj[0].obj.dur} `; }, @@ -184,7 +184,7 @@ export class Top10LongestRunTimeProcess extends BaseElement { * 大函数块拆解分为两部分,此部分为Top10线程数据 * @param result 需要显示在表格中的数据 */ - threadCallback(result: Array):void { + threadCallback(result: Array): void { this.nodataThr!.noData = result === undefined || result.length === 0; this.threadRunTimeTbl!.recycleDataSource = result; this.threadRunTimeTbl!.reMeauseHeight(); @@ -195,31 +195,31 @@ export class Top10LongestRunTimeProcess extends BaseElement { xField: 'tid', yField: 'dur', seriesField: 'size', - color: (a) => { - return '#0a59f7'; + color: (a): string => { + return '#0a59f7'; }, - hoverHandler: (data) => { + hoverHandler: (data): void => { if (data) { this.threadRunTimeTbl!.setCurrentHover(data); } else { this.threadRunTimeTbl!.mouseOut(); } }, - tip: (obj) => { + tip: (obj): string => { return `
Process_Id:${ - // @ts-ignore - obj[0].obj.pid}
+ // @ts-ignore + obj[0].obj.pid}
Thread_Id:${ - // @ts-ignore - obj[0].obj.tid}
+ // @ts-ignore + obj[0].obj.tid}
Thread_Name:${ - // @ts-ignore - obj[0].obj.tName}
+ // @ts-ignore + obj[0].obj.tName}
Run_Time:${ - // @ts-ignore - obj[0].obj.dur}
+ // @ts-ignore + obj[0].obj.dur} `; }, @@ -317,36 +317,47 @@ export class Top10LongestRunTimeProcess extends BaseElement { * @param detail 点击的列名,以及排序状态0 1 2分别代表不排序、升序排序、降序排序 * @param data 表格中需要排序的数据 */ - sortByColumn(detail: any, data: Array): void { + sortByColumn(detail: unknown, data: Array): void { // @ts-ignore function compare(processThreadCountProperty, sort, type) { - return function (a: any, b: any) { + return function (a: unknown, b: unknown) { if (type === 'number') { // @ts-ignore return sort === 2 + // @ts-ignore ? parseFloat(b[processThreadCountProperty]) - - parseFloat(a[processThreadCountProperty]) + // @ts-ignore + parseFloat(a[processThreadCountProperty]) + // @ts-ignore : parseFloat(a[processThreadCountProperty]) - - parseFloat(b[processThreadCountProperty]); + // @ts-ignore + parseFloat(b[processThreadCountProperty]); } else { if (sort === 2) { + // @ts-ignore return b[processThreadCountProperty] .toString() + // @ts-ignore .localeCompare(a[processThreadCountProperty].toString()); } else { + // @ts-ignore return a[processThreadCountProperty] .toString() + // @ts-ignore .localeCompare(b[processThreadCountProperty].toString()); } } }; } - if ( detail.key === 'pName' || detail.key === 'tName') { + // @ts-ignore + if (detail.key === 'pName' || detail.key === 'tName') { data.sort( + // @ts-ignore compare(detail.key, detail.sort, 'string') ); } else { data.sort( + // @ts-ignore compare(detail.key, detail.sort, 'number') ); } @@ -410,7 +421,7 @@ export class Top10LongestRunTimeProcess extends BaseElement { padding-right: 15px; } - ` + `; } /** diff --git a/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10ProcessSwitchCount.ts b/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10ProcessSwitchCount.ts index c2b050d8..a709616f 100644 --- a/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10ProcessSwitchCount.ts +++ b/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10ProcessSwitchCount.ts @@ -93,7 +93,7 @@ export class Top10ProcessSwitchCount extends BaseElement { */ queryLogicWorker(option: string, log: string, handler: (res: Array) => void, pid?: number): void { let processThreadCountTime = new Date().getTime(); - procedurePool.submitWithName('logic0', option, {pid: pid}, undefined, handler); + procedurePool.submitWithName('logic0', option, { pid: pid }, undefined, handler); let durTime = new Date().getTime() - processThreadCountTime; info(log, durTime); } @@ -109,8 +109,8 @@ export class Top10ProcessSwitchCount extends BaseElement { const pStr: string | null = this.processMap.get(arr[i].pid!)!; const tStr: string | null = this.threadMap.get(arr[i].tid!)!; result.push({ - NO: i + 1, - pid: arr[i].pid || this.processId, + NO: i + 1, + pid: arr[i].pid || this.processId, pName: pStr === null ? 'Process ' : pStr, switchCount: arr[i].occurrences, tid: arr[i].tid, @@ -151,25 +151,25 @@ export class Top10ProcessSwitchCount extends BaseElement { label: { type: 'outer', }, - hoverHandler: (data) => { + hoverHandler: (data): void => { if (data) { this.processSwitchCountTbl!.setCurrentHover(data); } else { this.processSwitchCountTbl!.mouseOut(); } }, - tip: (obj) => { + tip: (obj): string => { return `
Process_Id:${ - // @ts-ignore - obj.obj.pid}
+ // @ts-ignore + obj.obj.pid}
Process_Name:${ - // @ts-ignore - obj.obj.pName}
+ // @ts-ignore + obj.obj.pName}
Switch Count:${ - // @ts-ignore - obj.obj.switchCount}
+ // @ts-ignore + obj.obj.switchCount} `; }, @@ -201,28 +201,28 @@ export class Top10ProcessSwitchCount extends BaseElement { label: { type: 'outer', }, - hoverHandler: (data) => { + hoverHandler: (data): void => { if (data) { this.threadSwitchCountTbl!.setCurrentHover(data); } else { this.threadSwitchCountTbl!.mouseOut(); } }, - tip: (obj) => { + tip: (obj): string => { return `
Thread_Id:${ - // @ts-ignore - obj.obj.tid}
+ // @ts-ignore + obj.obj.tid}
Thread_Name:${ - // @ts-ignore - obj.obj.tName}
+ // @ts-ignore + obj.obj.tName}
Switch Count:${ - // @ts-ignore - obj.obj.switchCount}
+ // @ts-ignore + obj.obj.switchCount}
Process_Id:${ - // @ts-ignore - obj.obj.pid}
+ // @ts-ignore + obj.obj.pid} `; }, @@ -338,25 +338,33 @@ export class Top10ProcessSwitchCount extends BaseElement { * @param detail 点击的列名,以及排序状态0 1 2分别代表不排序、升序排序、降序排序 * @param data 表格中需要排序的数据 */ - sortByColumn(detail: {key: string, sort: number}, data: Array): void { + sortByColumn(detail: { key: string, sort: number }, data: Array): void { // @ts-ignore function compare(processThreadCountProperty, sort, type) { - return function (a: any, b: any) { + return function (a: unknown, b: unknown) { if (type === 'number') { // @ts-ignore return sort === 2 + // @ts-ignore ? parseFloat(b[processThreadCountProperty]) - - parseFloat(a[processThreadCountProperty]) + // @ts-ignore + parseFloat(a[processThreadCountProperty]) + // @ts-ignore : parseFloat(a[processThreadCountProperty]) - - parseFloat(b[processThreadCountProperty]); + // @ts-ignore + parseFloat(b[processThreadCountProperty]); } else { if (sort === 2) { + // @ts-ignore return b[processThreadCountProperty] .toString() + // @ts-ignore .localeCompare(a[processThreadCountProperty].toString()); } else { + // @ts-ignore return a[processThreadCountProperty] .toString() + // @ts-ignore .localeCompare(b[processThreadCountProperty].toString()); } } @@ -426,7 +434,7 @@ export class Top10ProcessSwitchCount extends BaseElement { * 节点html代码块 * @returns 返回节点代码块字符串 */ - initTagHtml() :string { + initTagHtml(): string { return `
@@ -487,5 +495,5 @@ interface Top10ProcSwiCount { pName?: string, tName?: string, switchCount?: number, - occurrences?: number + occurrences?: number } \ No newline at end of file diff --git a/ide/src/trace/component/setting/SpArkTs.ts b/ide/src/trace/component/setting/SpArkTs.ts index 72d25056..12623ca2 100644 --- a/ide/src/trace/component/setting/SpArkTs.ts +++ b/ide/src/trace/component/setting/SpArkTs.ts @@ -127,7 +127,7 @@ export class SpArkTs extends BaseElement { } else { Cmd.getDebugProcess().then((processList) => { if (processList.length > 0) { - this.processInput!.dataSource(processList, '',true); + this.processInput!.dataSource(processList, '', true); } else { this.processInput!.dataSource([], ''); } diff --git a/ide/src/trace/component/setting/SpHilogRecord.ts b/ide/src/trace/component/setting/SpHilogRecord.ts index da564a8b..1bcc7a70 100644 --- a/ide/src/trace/component/setting/SpHilogRecord.ts +++ b/ide/src/trace/component/setting/SpHilogRecord.ts @@ -71,7 +71,7 @@ export class SpHilogRecord extends BaseElement { } else { Cmd.getProcess().then((processList) => { if (processList.length > 0) { - this.processSelectEl!.dataSource(processList, 'ALL-Process',true); + this.processSelectEl!.dataSource(processList, 'ALL-Process', true); } else { this.processSelectEl!.dataSource([], ''); } diff --git a/ide/src/trace/component/setting/SpHisysEvent.ts b/ide/src/trace/component/setting/SpHisysEvent.ts index cdeb0530..77956729 100644 --- a/ide/src/trace/component/setting/SpHisysEvent.ts +++ b/ide/src/trace/component/setting/SpHisysEvent.ts @@ -106,7 +106,7 @@ export class SpHisysEvent extends BaseElement { this.eventConfig = JSON.parse(dec.decode(buffer)); let domainList = Object.keys(this.eventConfig!); if (domainList.length > 0) { - this.domainInputEL!.dataSource(domainList, 'ALL-Domain',true); + this.domainInputEL!.dataSource(domainList, 'ALL-Domain', true); } else { this.domainInputEL!.dataSource([], ''); } @@ -132,7 +132,7 @@ export class SpHisysEvent extends BaseElement { if (eventConfigElement) { let eventNameList = Object.keys(eventConfigElement); if (eventNameList?.length > 0) { - this.eventNameInputEL!.dataSource(eventNameList, 'ALL-Event',true); + this.eventNameInputEL!.dataSource(eventNameList, 'ALL-Event', true); } else { this.eventNameInputEL!.dataSource([], ''); } @@ -147,7 +147,7 @@ export class SpHisysEvent extends BaseElement { let eventList = Object.keys(currentEvent); currentData.push(...eventList); }); - this.eventNameInputEL!.dataSource(currentData, 'ALL-Event',true); + this.eventNameInputEL!.dataSource(currentData, 'ALL-Event', true); } else { this.eventNameInputEL!.dataSource([], ''); } diff --git a/ide/src/trace/component/setting/SpSdkConfig.ts b/ide/src/trace/component/setting/SpSdkConfig.ts index fe2ed6c0..a8426c1a 100644 --- a/ide/src/trace/component/setting/SpSdkConfig.ts +++ b/ide/src/trace/component/setting/SpSdkConfig.ts @@ -170,7 +170,7 @@ export class SpSdkConfig extends BaseElement { }); } }) - .catch(() => {}); + .catch(() => { }); if (this.worker === null) { // @ts-ignore if (window.useWb) { @@ -178,7 +178,7 @@ export class SpSdkConfig extends BaseElement { } this.worker = new Worker(new URL('../../database/ConfigWorker', import.meta.url)); } - } catch (e) {} + } catch (e) { } } initElements(): void { @@ -200,7 +200,7 @@ export class SpSdkConfig extends BaseElement { inputDiv.addEventListener('mousedown', () => { if (this.startSamp) { inputDiv!.removeAttribute('readonly'); - this.selectConfig!.dataSource(this.wasmList, '',true); + this.selectConfig!.dataSource(this.wasmList, '', true); } else { inputDiv!.setAttribute('readonly', 'readonly'); return; diff --git a/ide/src/trace/component/setting/SpVmTracker.ts b/ide/src/trace/component/setting/SpVmTracker.ts index fbe3b440..c8d53df7 100644 --- a/ide/src/trace/component/setting/SpVmTracker.ts +++ b/ide/src/trace/component/setting/SpVmTracker.ts @@ -80,7 +80,7 @@ export class SpVmTracker extends BaseElement { } else { Cmd.getProcess().then((processList) => { if (processList.length > 0) { - this.vmTrackerProcessInput!.dataSource(processList, '',true); + this.vmTrackerProcessInput!.dataSource(processList, '', true); } else { this.vmTrackerProcessInput!.dataSource([], ''); } diff --git a/ide/src/trace/component/trace/base/TraceRow.ts b/ide/src/trace/component/trace/base/TraceRow.ts index 005cc61e..ccae04b4 100644 --- a/ide/src/trace/component/trace/base/TraceRow.ts +++ b/ide/src/trace/component/trace/base/TraceRow.ts @@ -219,7 +219,7 @@ export class TraceRow extends HTMLElement { asyncFuncStartTID!: number | undefined; protoParentId: string | null | undefined; protoPid: string | undefined; - summaryProtoPid: Array | undefined; + summaryProtoPid: Array | undefined; constructor( args: { @@ -1544,11 +1544,11 @@ export class TraceRow extends HTMLElement { let rectY = myRect.y; let rectHeight = myRect.height; if (!inFavoriteArea && favoriteHeight !== undefined) { - let expand = sessionStorage.getItem('expand'); + let expand = sessionStorage.getItem('expand'); let foldHeight = Number(sessionStorage.getItem('foldHeight')); - y = expand === 'true' ? - (e.offsetY + prevScrollY - 148 - favoriteHeight!) : - (e.offsetY + prevScrollY - (148 - foldHeight) - favoriteHeight!); + y = expand === 'true' ? + (e.offsetY + prevScrollY - 148 - favoriteHeight!) : + (e.offsetY + prevScrollY - (148 - foldHeight) - favoriteHeight!); rectY = this.offsetTop; rectHeight = this.clientHeight; } diff --git a/ide/src/trace/component/trace/sheet/cpu/TabPaneCpuByThread.ts b/ide/src/trace/component/trace/sheet/cpu/TabPaneCpuByThread.ts index d03da128..6f1d0e38 100644 --- a/ide/src/trace/component/trace/sheet/cpu/TabPaneCpuByThread.ts +++ b/ide/src/trace/component/trace/sheet/cpu/TabPaneCpuByThread.ts @@ -254,7 +254,7 @@ export class TabPaneCpuByThread extends BaseElement { }; data.forEach((obj) => { // 聚合 cpu 数据 - if (obj.cat === "cpu") { + if (obj.cat === 'cpu') { const tidPidKey = `${obj.tid}-${obj.pid}`; const cpuDurationKey = `cpu${obj.cpu}`; const cpuPercentKey = `cpu${obj.cpu}Ratio`; @@ -281,11 +281,11 @@ export class TabPaneCpuByThread extends BaseElement { } // 聚合 softirq 数据 - if (obj.cat === "softirq") { + if (obj.cat === 'softirq') { this.updateIrqAndSoftirq(softirqAggregations, obj, cpuByThreadValue); } // 聚合 irq 数据 - if (obj.cat === "irq") { + if (obj.cat === 'irq') { this.updateIrqAndSoftirq(irqAggregations, obj, cpuByThreadValue); } diff --git a/ide/src/trace/component/trace/sheet/cpu/TabPaneSchedPriority.ts b/ide/src/trace/component/trace/sheet/cpu/TabPaneSchedPriority.ts index 28eb279a..b1a39997 100644 --- a/ide/src/trace/component/trace/sheet/cpu/TabPaneSchedPriority.ts +++ b/ide/src/trace/component/trace/sheet/cpu/TabPaneSchedPriority.ts @@ -142,7 +142,7 @@ export class TabPaneSchedPriority extends BaseElement { private async fetchAndProcessData(): Promise { if (this.strValueMap.size === 0) { - let res = await queryArgsById('next_info', this.selectionParam?.traceId || undefined) + let res = await queryArgsById('next_info', this.selectionParam?.traceId || undefined); await queryThreadStateArgsById(res[0].id, this.selectionParam?.traceId || undefined). then((value): void => { for (const item of value) { diff --git a/ide/src/trace/component/trace/sheet/freq/TabPaneCpuFreqLimits.ts b/ide/src/trace/component/trace/sheet/freq/TabPaneCpuFreqLimits.ts index 8330f99e..225de2af 100644 --- a/ide/src/trace/component/trace/sheet/freq/TabPaneCpuFreqLimits.ts +++ b/ide/src/trace/component/trace/sheet/freq/TabPaneCpuFreqLimits.ts @@ -105,14 +105,14 @@ export class TabPaneCpuFreqLimits extends BaseElement { return item; }); this.cpuFreqLimitSource.sort((a, b): number => { - let cpuLeftData = Number(a.cpu.toString().replace('Cpu','')); - let cpuRightData = Number(b.cpu.toString().replace('Cpu','')); + let cpuLeftData = Number(a.cpu.toString().replace('Cpu', '')); + let cpuRightData = Number(b.cpu.toString().replace('Cpu', '')); if (cpuLeftData > cpuRightData) { return 1; - }else{ + } else { return -1; } - }) + }); this.sortCpuFreqLimitTable(this.cpuFreqLimitSortKey, this.cpuFreqLimitSortType); } @@ -160,12 +160,12 @@ export class TabPaneCpuFreqLimits extends BaseElement { compareCpu(cpuFreqLimitA: unknown, cpuFreqLimitB: unknown, type: number): number { // @ts-ignore - let cpuLeftData = Number(cpuFreqLimitA.cpu.toString().replace('Cpu','')); + let cpuLeftData = Number(cpuFreqLimitA.cpu.toString().replace('Cpu', '')); // @ts-ignore - let cpuRightData = Number(cpuFreqLimitB.cpu.toString().replace('Cpu','')); + let cpuRightData = Number(cpuFreqLimitB.cpu.toString().replace('Cpu', '')); if (type === 1) { return cpuLeftData - cpuRightData; - }else{ + } else { return cpuRightData - cpuLeftData; } } diff --git a/ide/src/trace/component/trace/sheet/frequsage/TabPaneFreqUsage.ts b/ide/src/trace/component/trace/sheet/frequsage/TabPaneFreqUsage.ts index dac1df4c..f5ba6087 100644 --- a/ide/src/trace/component/trace/sheet/frequsage/TabPaneFreqUsage.ts +++ b/ide/src/trace/component/trace/sheet/frequsage/TabPaneFreqUsage.ts @@ -13,29 +13,29 @@ * limitations under the License. */ -import { BaseElement, element } from "../../../../../base-ui/BaseElement"; +import { BaseElement, element } from '../../../../../base-ui/BaseElement'; import { LitTable, RedrawTreeForm, -} from "../../../../../base-ui/table/lit-table"; -import { SelectionParam } from "../../../../bean/BoxSelection"; -import "../../../StackBar"; -import { getTabRunningPercent } from "../../../../database/sql/ProcessThread.sql"; +} from '../../../../../base-ui/table/lit-table'; +import { SelectionParam } from '../../../../bean/BoxSelection'; +import '../../../StackBar'; +import { getTabRunningPercent } from '../../../../database/sql/ProcessThread.sql'; import { queryCpuFreqUsageData, queryCpuFreqFilterId, -} from "../../../../database/sql/Cpu.sql"; -import { Utils } from "../../base/Utils"; -import { resizeObserver } from "../SheetUtils"; -import { SpSegmentationChart } from "../../../chart/SpSegmentationChart"; +} from '../../../../database/sql/Cpu.sql'; +import { Utils } from '../../base/Utils'; +import { resizeObserver } from '../SheetUtils'; +import { SpSegmentationChart } from '../../../chart/SpSegmentationChart'; import { type CpuFreqData, type RunningFreqData, type RunningData, type CpuFreqTd, -} from "./TabPaneFreqUsageConfig"; +} from './TabPaneFreqUsageConfig'; -@element("tabpane-frequsage") +@element('tabpane-frequsage') export class TabPaneFreqUsage extends BaseElement { private threadStatesTbl: LitTable | null | undefined; private currentSelectionParam: SelectionParam | undefined; @@ -117,20 +117,20 @@ export class TabPaneFreqUsage extends BaseElement { */ private threadClick(data: Array): void { let labels = this.threadStatesTbl?.shadowRoot - ?.querySelector(".th > .td")! - .querySelectorAll("label"); + ?.querySelector('.th > .td')! + .querySelectorAll('label'); if (labels) { for (let i = 0; i < labels.length; i++) { let label = labels[i].innerHTML; - labels[i].addEventListener("click", (e) => { - if (label.includes("Process") && i === 0) { + labels[i].addEventListener('click', (e) => { + if (label.includes('Process') && i === 0) { this.threadStatesTbl!.setStatus(data, false); this.threadStatesTbl!.recycleDs = this.threadStatesTbl!.meauseTreeRowElement( data, RedrawTreeForm.Retract ); - } else if (label.includes("Thread") && i === 1) { + } else if (label.includes('Thread') && i === 1) { for (let item of data) { // @ts-ignore item.status = true; @@ -143,7 +143,7 @@ export class TabPaneFreqUsage extends BaseElement { data, RedrawTreeForm.Retract ); - } else if (label.includes("CPU") && i === 2) { + } else if (label.includes('CPU') && i === 2) { this.threadStatesTbl!.setStatus(data, true); this.threadStatesTbl!.recycleDs = this.threadStatesTbl!.meauseTreeRowElement( @@ -159,11 +159,11 @@ export class TabPaneFreqUsage extends BaseElement { initElements(): void { this.threadStatesTbl = this.shadowRoot?.querySelector( - "#tb-running-percent" + '#tb-running-percent' ); //开启一个线程计算busyTime this.worker = new Worker( - new URL("../../../../database/TabPaneFreqUsageWorker", import.meta.url) + new URL('../../../../database/TabPaneFreqUsageWorker', import.meta.url) ); TabPaneFreqUsage.element = this; } diff --git a/ide/src/trace/component/trace/sheet/hiperf/TabPerfBottomUp.ts b/ide/src/trace/component/trace/sheet/hiperf/TabPerfBottomUp.ts index e16e6aed..ac9e87b1 100644 --- a/ide/src/trace/component/trace/sheet/hiperf/TabPerfBottomUp.ts +++ b/ide/src/trace/component/trace/sheet/hiperf/TabPerfBottomUp.ts @@ -58,7 +58,7 @@ export class TabpanePerfBottomUp extends BaseElement { findSearchNode(this.bottomUpSource, this.searchValue, false); } if (HiPerfStruct.bottomFindCount === 0 && this.bottomUpFilter!.filterValue !== '') { - this.bottomUpTable!.recycleDataSource = [] + this.bottomUpTable!.recycleDataSource = []; } else { this.bottomUpTable!.setStatus(this.bottomUpSource, true); this.setBottomUpTableData(this.bottomUpSource); -- Gitee From e00b1ee2a0136f9616fa65962ab7b5e2cc3b50b4 Mon Sep 17 00:00:00 2001 From: liufei Date: Tue, 3 Sep 2024 16:09:43 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=E4=BB=A3=E7=A0=81=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E9=81=97=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liufei --- .../trace/component/trace/sheet/native-memory/TabPaneNMemory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ide/src/trace/component/trace/sheet/native-memory/TabPaneNMemory.ts b/ide/src/trace/component/trace/sheet/native-memory/TabPaneNMemory.ts index 9933db85..46414ffa 100644 --- a/ide/src/trace/component/trace/sheet/native-memory/TabPaneNMemory.ts +++ b/ide/src/trace/component/trace/sheet/native-memory/TabPaneNMemory.ts @@ -140,7 +140,7 @@ export class TabPaneNMemory extends BaseElement { let tmpNumber = item.addr.split('x'); //@ts-ignore item.addr = '0x' + Number(tmpNumber[1]).toString(16); - }) + }); this.memorySource = results; this.memoryTbl!.recycleDataSource = this.memorySource; } else { -- Gitee From f1024a1c4d869eee7412d36f435b8184a0eb0e47 Mon Sep 17 00:00:00 2001 From: liufei Date: Tue, 3 Sep 2024 16:44:03 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=E4=BB=A3=E7=A0=81=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E9=81=97=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liufei --- .../component/chart/SpImportUserPluginsChart.ts | 14 +++++++++----- .../component/trace/sheet/hang/TabPaneHang.ts | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ide/src/trace/component/chart/SpImportUserPluginsChart.ts b/ide/src/trace/component/chart/SpImportUserPluginsChart.ts index 3baccaff..27cc14a6 100644 --- a/ide/src/trace/component/chart/SpImportUserPluginsChart.ts +++ b/ide/src/trace/component/chart/SpImportUserPluginsChart.ts @@ -169,9 +169,11 @@ export class SpImportUserPluginsChart { `${ProcessMemStruct.hoverProcessMemStruct?.value || '0'}` ); }; - childRow.onThreadHandler = rowThreadHandler('mem', 'context',//@ts-ignore + childRow.onThreadHandler = rowThreadHandler('mem', 'context', + //@ts-ignore { type: `mem ${element.rowId} ${element.name}` }, childRow, this.trace); - } else if (item.rowType === TraceRow.ROW_TYPE_FUNC) {//处理func + } else if (item.rowType === TraceRow.ROW_TYPE_FUNC) { + //处理func //@ts-ignore if (element.asyncFuncName) { //@ts-ignore @@ -192,9 +194,11 @@ export class SpImportUserPluginsChart { //@ts-ignore FuncStruct.hoverFuncStruct = childRow.getHoverStruct(); }; - childRow.onThreadHandler = rowThreadHandler('func', 'context',//@ts-ignore + childRow.onThreadHandler = rowThreadHandler('func', 'context', + //@ts-ignore { type: '' }, childRow, this.trace); - } else if (item.rowType === TraceRow.ROW_TYPE_THREAD) {//处理thread + } else if (item.rowType === TraceRow.ROW_TYPE_THREAD) { + //处理thread childRow.onThreadHandler = rowThreadHandler('thread', 'context', { type: '', translateY: childRow.translateY }, childRow, this.trace); } @@ -226,7 +230,7 @@ export class SpImportUserPluginsChart { new CustomEvent('file-error') ); } - } + }; }); } } diff --git a/ide/src/trace/component/trace/sheet/hang/TabPaneHang.ts b/ide/src/trace/component/trace/sheet/hang/TabPaneHang.ts index b09ded83..4a3d5b1e 100644 --- a/ide/src/trace/component/trace/sheet/hang/TabPaneHang.ts +++ b/ide/src/trace/component/trace/sheet/hang/TabPaneHang.ts @@ -286,7 +286,7 @@ export class HangStructInPane { this.dur = getTimeString(parent.dur ?? 0); this.pname = `${parent.pname ?? this.pname} ${parent.pid ?? ''}`.trim(); this.type = SpHangChart.calculateHangType(parent.dur ?? 0); - [this.sendEventTid, this.sendTime, this.expectHandleTime, this.taskNameId, this.prio, this.caller] = (parent.content ?? ",0,0,,,").split(',').map(i => i.trim()); + [this.sendEventTid, this.sendTime, this.expectHandleTime, this.taskNameId, this.prio, this.caller] = (parent.content ?? ',0,0,,,').split(',').map(i => i.trim()); this.sendEventTid = this.sendEventTid.split(':').at(-1)!; } -- Gitee