diff --git a/ide/src/trace/component/SpSystemTrace.ts b/ide/src/trace/component/SpSystemTrace.ts
index 57ee013d482fa017794844be62b2b4a958b6ad60..7338b3bf542b35faf475e7f90bbc6b25a5875aba 100644
--- a/ide/src/trace/component/SpSystemTrace.ts
+++ b/ide/src/trace/component/SpSystemTrace.ts
@@ -272,9 +272,28 @@ export class SpSystemTrace extends BaseElement {
if (SpSystemTrace.btnTimer) {
return;
}
- this.wakeupListNull();
- SpSystemTrace.wakeupList.unshift(CpuStruct.wakeupBean!);
- this.queryCPUWakeUpList(CpuStruct.wakeupBean!);
+ // 唤醒树有值则不再重复添加
+ const startIndex = CpuStruct.selectCpuStruct!.displayProcess?.indexOf('[')
+ if (SpSystemTrace.wakeupList.length === 0) {
+ SpSystemTrace.wakeupList.unshift(CpuStruct.wakeupBean!);
+ this.queryCPUWakeUpList(CpuStruct.wakeupBean!);
+ CpuStruct.selectCpuStruct!.ts = CpuStruct.selectCpuStruct!.startTime;
+ CpuStruct.selectCpuStruct!.thread = CpuStruct.selectCpuStruct!.name;
+ CpuStruct.selectCpuStruct!.pid = CpuStruct.selectCpuStruct!.processId;
+ CpuStruct.selectCpuStruct!.process = CpuStruct.selectCpuStruct!.displayProcess?.substring(0, startIndex).trim();
+ CpuStruct.selectCpuStruct!.itid = CpuStruct.wakeupBean!.itid;
+ sessionStorage.setItem('saveselectcpustruct', JSON.stringify(CpuStruct.selectCpuStruct))
+ } else {
+ this.wakeupListNull()
+ SpSystemTrace.wakeupList.unshift(CpuStruct.wakeupBean!);
+ this.queryCPUWakeUpList(CpuStruct.wakeupBean!);
+ CpuStruct.selectCpuStruct!.ts = CpuStruct.selectCpuStruct!.startTime;
+ CpuStruct.selectCpuStruct!.thread = CpuStruct.selectCpuStruct!.name;
+ CpuStruct.selectCpuStruct!.pid = CpuStruct.selectCpuStruct!.processId;
+ CpuStruct.selectCpuStruct!.process = CpuStruct.selectCpuStruct!.displayProcess?.substring(0, startIndex).trim();
+ CpuStruct.selectCpuStruct!.itid = CpuStruct.wakeupBean!.itid;
+ sessionStorage.setItem('saveselectcpustruct', JSON.stringify(CpuStruct.selectCpuStruct))
+ }
setTimeout(() => {
requestAnimationFrame(() => this.refreshCanvas(false));
}, 300);
@@ -716,8 +735,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!);
@@ -1073,7 +1092,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 = [];
@@ -1156,7 +1175,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!);
@@ -1330,7 +1349,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);
});
@@ -1790,7 +1809,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');
}
@@ -1956,13 +1975,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();
@@ -2504,7 +2523,35 @@ export class SpSystemTrace extends BaseElement {
if (!this.loadTraceCompleted) return;
this.queryAllTraceRow().forEach((it) => (it.rangeSelect = false));
this.selectStructNull();
- this.wakeupListNull();
+ // 判断点击的线程是否在唤醒树内
+ let timeoutJudge = setTimeout(() => {
+ if (SpSystemTrace.wakeupList.length && CpuStruct.wakeupBean) {
+ let checkHandlerKey = true;
+ for (const item of SpSystemTrace.wakeupList) {
+ if (item.ts === CpuStruct.wakeupBean.ts && item.wakeupTime === CpuStruct.wakeupBean.wakeupTime) {
+ checkHandlerKey = false;
+ if (SpSystemTrace.wakeupList[0].schedulingDesc) {
+ SpSystemTrace.wakeupList.unshift(JSON.parse(sessionStorage.getItem('saveselectcpustruct')!))
+ }
+ this.refreshCanvas(true)
+ break;
+ }
+ }
+ // 点击线程在唤醒树内
+ if (!checkHandlerKey) {
+ // 查询获取tab表格数据
+ window.publish(window.SmartEvent.UI.WakeupList, SpSystemTrace.wakeupList);
+ } else {
+ // 不在唤醒树内,清空数组
+ this.wakeupListNull()
+ this.refreshCanvas(true)
+ }
+ } else {
+ this.wakeupListNull();
+ this.refreshCanvas(true)
+ }
+ clearTimeout(timeoutJudge)
+ }, 500);
let threadClickHandler: any;
let threadClickPreviousHandler: any;
let threadClickNextHandler: any;
@@ -4186,8 +4233,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) => {
diff --git a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts
index 7e9fb1eab7cb8d8de9ee2290583fe241abde4912..12344f410eec5315c5592c9f02e9475d903909f8 100644
--- a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts
+++ b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts
@@ -159,7 +159,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.startTime || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startTime || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({ name: 'Duration', value: getTimeString(data.dur || 0) });
list.push({ name: 'Prio', value: data.priority || 0 });
@@ -324,7 +324,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.startTs || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startTs || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({
name: 'Duration',
@@ -342,7 +342,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
contentList.push({
name: 'StartTime(Absolute)',
- value: ((data.startTs || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startTs || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
contentList.push({
name: 'Duration',
@@ -385,7 +385,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.startNS || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startNS || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({
name: 'Value',
@@ -410,7 +410,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.startTime || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startTime || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({ name: 'Value', value: data.value });
list.push({ name: 'Delta', value: data.delta });
@@ -436,7 +436,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.startNS || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startNS || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({ name: 'Name', value: data.name });
list.push({ name: 'Duration', value: getTimeString(data.dur || 0) });
@@ -472,7 +472,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.startTime || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startTime || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({ name: 'Duration', value: getTimeString(data.dur || 0) });
let state;
@@ -761,7 +761,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.ts || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.ts || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({
name: 'end time',
@@ -783,7 +783,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.rs_ts || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.rs_ts || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({
name: 'end time',
@@ -843,7 +843,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.startTs || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startTs || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
if (data.dur && data.dur > 0) {
list.push({
@@ -927,7 +927,7 @@ export class TabPaneCurrentSelection extends BaseElement {
});
list.push({
name: 'StartTime(Absolute)',
- value: ((data.startTs || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.startTs || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({ name: 'Duration', value: getTimeString(data.dur || 0) });
this.currentSelectionTbl!.dataSource = list;
@@ -1007,7 +1007,7 @@ export class TabPaneCurrentSelection extends BaseElement {
list.push({ name: 'StartTime(Relative)', value: getTimeString(data.ts || 0) });
list.push({
name: 'StartTime(Absolute)',
- value: ((data.ts || 0) + (window as any).recordStartNS) / 1000000000,
+ value: ((data.ts || 0) + (window as any).recordStartNS) / 1000000000 + 's',
});
list.push({ name: 'Duration', value: data.dur ? getTimeString(data.dur) : ' ' });
if (data.frame_type !== 'frameTime') {
@@ -1260,7 +1260,10 @@ export class TabPaneCurrentSelection extends BaseElement {
return wake;
});
if (this.selectWakeupBean) {
- resource.unshift(this.selectWakeupBean);
+ // 点击第一层唤醒树时向数组头部添加当前点击信息
+ if (data[0].schedulingLatency) {
+ resource.unshift(this.selectWakeupBean);
+ }
maxDuration = Math.max(maxDuration, this.selectWakeupBean.dur);
maxPriority = Math.max(maxPriority, this.selectWakeupBean.priority);
}
diff --git a/ide/src/trace/component/trace/sheet/cpu/TabPaneCounterSample.ts b/ide/src/trace/component/trace/sheet/cpu/TabPaneCounterSample.ts
index f3272ad277bf5350f8b14cf785330027e23dc295..5cddc7fda7428fe0ec6d67281c1856101e4d8768 100644
--- a/ide/src/trace/component/trace/sheet/cpu/TabPaneCounterSample.ts
+++ b/ide/src/trace/component/trace/sheet/cpu/TabPaneCounterSample.ts
@@ -97,7 +97,7 @@ export class TabPaneCounterSample extends BaseElement {
cpuStateFilter[i].value === data.value &&
cpuStateFilter[i].cpu === data.cpu &&
Math.max(TraceRow.rangeSelectObject?.startNS!, cpuStateFilter[i].startTs!) <
- Math.min(TraceRow.rangeSelectObject?.endNS!, cpuStateFilter[i].startTs! + cpuStateFilter[i].dur!)
+ Math.min(TraceRow.rangeSelectObject?.endNS!, cpuStateFilter[i].startTs! + cpuStateFilter[i].dur!)
) {
CpuStateStruct.hoverStateStruct = cpuStateFilter[i];
}
@@ -185,6 +185,7 @@ export class TabPaneCounterSample extends BaseElement {
sampleMap.set(item.filterId + '-' + item.value, {
...item,
counter: 'Cpu ' + item.cpu,
+ count: initCounterResultList.filter(ele => ele.value === item.value).length
});
}
});
@@ -259,6 +260,8 @@ export class TabPaneCounterSample extends BaseElement {