From e7dadfa620f1d6470c5aff0f9c0e4e9b84e59489 Mon Sep 17 00:00:00 2001 From: wangziyi Date: Mon, 23 Oct 2023 14:25:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=94=A4=E9=86=92=E6=A0=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangziyi --- ide/src/trace/component/SpSystemTrace.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ide/src/trace/component/SpSystemTrace.ts b/ide/src/trace/component/SpSystemTrace.ts index cea324a23..3748a7238 100644 --- a/ide/src/trace/component/SpSystemTrace.ts +++ b/ide/src/trace/component/SpSystemTrace.ts @@ -2531,15 +2531,15 @@ export class SpSystemTrace extends BaseElement { this.selectStructNull(); // 判断点击的线程是否在唤醒树内 let timeoutJudge = setTimeout(() => { - if (SpSystemTrace.wakeupList.length && CpuStruct.wakeupBean) { + if (SpSystemTrace.wakeupList.length && CpuStruct.selectCpuStruct) { let checkHandlerKey = true; for (const item of SpSystemTrace.wakeupList) { - if (item.ts === CpuStruct.wakeupBean.ts && item.wakeupTime === CpuStruct.wakeupBean.wakeupTime) { + if (item.ts === CpuStruct.selectCpuStruct.startTime && item.dur === CpuStruct.selectCpuStruct.dur) { checkHandlerKey = false; if (SpSystemTrace.wakeupList[0].schedulingDesc) { - SpSystemTrace.wakeupList.unshift(JSON.parse(sessionStorage.getItem('saveselectcpustruct')!)); + SpSystemTrace.wakeupList.unshift(JSON.parse(sessionStorage.getItem('saveselectcpustruct')!)) } - this.refreshCanvas(true); + this.refreshCanvas(true) break; } } @@ -2549,15 +2549,15 @@ export class SpSystemTrace extends BaseElement { window.publish(window.SmartEvent.UI.WakeupList, SpSystemTrace.wakeupList); } else { // 不在唤醒树内,清空数组 - this.wakeupListNull(); - this.refreshCanvas(true); + this.wakeupListNull() + this.refreshCanvas(true) } } else { this.wakeupListNull(); - this.refreshCanvas(true); + this.refreshCanvas(true) } - clearTimeout(timeoutJudge); - }, 500); + clearTimeout(timeoutJudge) + }, 10); let threadClickHandler: any; let threadClickPreviousHandler: any; let threadClickNextHandler: any; -- Gitee From 1f90a37f19667b0fd55ae498b27b9f70e49f2770 Mon Sep 17 00:00:00 2001 From: wangziyi Date: Mon, 23 Oct 2023 14:33:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=A4=E9=86=92?= =?UTF-8?q?=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangziyi --- ide/src/trace/component/SpSystemTrace.ts | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ide/src/trace/component/SpSystemTrace.ts b/ide/src/trace/component/SpSystemTrace.ts index 3748a7238..bd4bac7e0 100644 --- a/ide/src/trace/component/SpSystemTrace.ts +++ b/ide/src/trace/component/SpSystemTrace.ts @@ -733,8 +733,8 @@ export class SpSystemTrace extends BaseElement { let isIntersect = (filterFunc: FuncStruct, rangeData: RangeSelectStruct) => Math.max(filterFunc.startTs! + filterFunc.dur!, rangeData!.endNS || 0) - - Math.min(filterFunc.startTs!, rangeData!.startNS || 0) < - filterFunc.dur! + (rangeData!.endNS || 0) - (rangeData!.startNS || 0) && + Math.min(filterFunc.startTs!, rangeData!.startNS || 0) < + filterFunc.dur! + (rangeData!.endNS || 0) - (rangeData!.startNS || 0) && filterFunc.funName!.indexOf('H:Task ') >= 0; let taskData = it.dataList.filter((taskData: FuncStruct) => { taskData!.tid = parseInt(it.rowId!); @@ -1090,7 +1090,7 @@ export class SpSystemTrace extends BaseElement { } else if (it.rowType == TraceRow.ROW_TYPE_JANK) { let isIntersect = (filterJank: JanksStruct, rangeData: RangeSelectStruct) => Math.max(filterJank.ts! + filterJank.dur!, rangeData!.endNS || 0) - - Math.min(filterJank.ts!, rangeData!.startNS || 0) < + Math.min(filterJank.ts!, rangeData!.startNS || 0) < filterJank.dur! + (rangeData!.endNS || 0) - (rangeData!.startNS || 0); if (it.name == 'Actual Timeline') { selection.jankFramesData = []; @@ -1173,7 +1173,7 @@ export class SpSystemTrace extends BaseElement { } else if (it.rowType == TraceRow.ROW_TYPE_FRAME_ANIMATION) { let isIntersect = (animationStruct: FrameAnimationStruct, selectStruct: RangeSelectStruct) => Math.max(animationStruct.startTs! + animationStruct.dur!, selectStruct!.endNS || 0) - - Math.min(animationStruct.startTs!, selectStruct!.startNS || 0) < + Math.min(animationStruct.startTs!, selectStruct!.startNS || 0) < animationStruct.dur! + (selectStruct!.endNS || 0) - (selectStruct!.startNS || 0); let frameAnimationList = it.dataList.filter((frameAnimationBean: FrameAnimationStruct) => { return isIntersect(frameAnimationBean, TraceRow.rangeSelectObject!); @@ -1347,7 +1347,7 @@ export class SpSystemTrace extends BaseElement { window.subscribe(window.SmartEvent.UI.SliceMark, (data) => { this.sliceMarkEventHandler(data); }); - window.subscribe(window.SmartEvent.UI.TraceRowComplete, (tr) => {}); + window.subscribe(window.SmartEvent.UI.TraceRowComplete, (tr) => { }); window.subscribe(window.SmartEvent.UI.RefreshCanvas, () => { this.refreshCanvas(false); }); @@ -1800,7 +1800,7 @@ export class SpSystemTrace extends BaseElement { // 如果没有找到帽子,则绘制一个旗子 let time = Math.round( (x * (TraceRow.range?.endNS! - TraceRow.range?.startNS!)) / this.timerShaftEL!.canvas!.offsetWidth + - TraceRow.range?.startNS! + TraceRow.range?.startNS! ); this.timerShaftEL!.sportRuler!.drawTriangle(time, 'squre'); } @@ -1977,13 +1977,13 @@ export class SpSystemTrace extends BaseElement { this.timerShaftEL?.setSlicesMark( FrameAnimationStruct.selectFrameAnimationStruct.startTs || 0, (FrameAnimationStruct.selectFrameAnimationStruct.startTs || 0) + - (FrameAnimationStruct.selectFrameAnimationStruct.dur || 0) + (FrameAnimationStruct.selectFrameAnimationStruct.dur || 0) ); } else if (JsCpuProfilerStruct.selectJsCpuProfilerStruct) { this.timerShaftEL?.setSlicesMark( JsCpuProfilerStruct.selectJsCpuProfilerStruct.startTime || 0, (JsCpuProfilerStruct.selectJsCpuProfilerStruct.startTime || 0) + - (JsCpuProfilerStruct.selectJsCpuProfilerStruct.totalTime || 0) + (JsCpuProfilerStruct.selectJsCpuProfilerStruct.totalTime || 0) ); } else { this.slicestime = this.timerShaftEL?.setSlicesMark(); @@ -2539,7 +2539,7 @@ export class SpSystemTrace extends BaseElement { if (SpSystemTrace.wakeupList[0].schedulingDesc) { SpSystemTrace.wakeupList.unshift(JSON.parse(sessionStorage.getItem('saveselectcpustruct')!)) } - this.refreshCanvas(true) + this.refreshCanvas(true); break; } } @@ -2549,14 +2549,14 @@ export class SpSystemTrace extends BaseElement { window.publish(window.SmartEvent.UI.WakeupList, SpSystemTrace.wakeupList); } else { // 不在唤醒树内,清空数组 - this.wakeupListNull() - this.refreshCanvas(true) + this.wakeupListNull(); + this.refreshCanvas(true); } } else { this.wakeupListNull(); - this.refreshCanvas(true) + this.refreshCanvas(true); } - clearTimeout(timeoutJudge) + clearTimeout(timeoutJudge); }, 10); let threadClickHandler: any; let threadClickPreviousHandler: any; @@ -4237,8 +4237,8 @@ export class SpSystemTrace extends BaseElement { HeapDataInterface.getInstance().clearData(); procedurePool.clearCache(); Utils.clearData(); - procedurePool.submitWithName('logic0', 'clear', {}, undefined, (res: any) => {}); - procedurePool.submitWithName('logic1', 'clear', {}, undefined, (res: any) => {}); + procedurePool.submitWithName('logic0', 'clear', {}, undefined, (res: any) => { }); + procedurePool.submitWithName('logic1', 'clear', {}, undefined, (res: any) => { }); } init = async (param: { buf?: ArrayBuffer; url?: string }, wasmConfigUri: string, progress: Function) => { -- Gitee