From 5b8e4361508c58b6773dd6e896c17a5bbbc8e810 Mon Sep 17 00:00:00 2001 From: wangziyi Date: Sat, 11 Jan 2025 16:03:35 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0xpower=E6=8A=93?= =?UTF-8?q?=E5=8F=96=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangziyi --- ide/src/trace/component/SpAdvertisement.ts | 9 ++++----- ide/src/trace/component/SpRecordConfigModel.ts | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ide/src/trace/component/SpAdvertisement.ts b/ide/src/trace/component/SpAdvertisement.ts index 9fcf8e6e6..d5ad2402a 100644 --- a/ide/src/trace/component/SpAdvertisement.ts +++ b/ide/src/trace/component/SpAdvertisement.ts @@ -54,11 +54,9 @@ export class SpAdvertisement extends BaseElement { this.message = resp.data.data; localStorage.setItem('message', this.message); let parts = this.message.split(';'); - let registrationLinkInfo = (parts[2].match(/报名链接:([^\s]+)/) || [])[1] || ''; - let onlineMeetingLinkInfo = (parts[3].match(/线上会议链接:([^\s]+)/) || [])[1] || ''; - let registrationLink = `报名链接`; - let onlineMeetingLink = `线上会议链接`; - let finalString = `${parts[0]}
${parts[1]}
${registrationLink}   ${onlineMeetingLink}
${parts[4]}`; + let registrationLinkInfo = (parts[2].match(/版本特性链接:([^\s]+)/) || [])[1] || ''; + let registrationLink = `版本特性链接`; + let finalString = `${parts[0]}
${parts[1]}
${registrationLink}`; this.noticeEl!.innerHTML = `

${finalString}

`; if (publish) { if (resp.data.data !== publish) { @@ -81,6 +79,7 @@ export class SpAdvertisement extends BaseElement { }); } + initHtml(): string { return SpAdvertisementHtml; } diff --git a/ide/src/trace/component/SpRecordConfigModel.ts b/ide/src/trace/component/SpRecordConfigModel.ts index 27f1e0106..da0f365c9 100644 --- a/ide/src/trace/component/SpRecordConfigModel.ts +++ b/ide/src/trace/component/SpRecordConfigModel.ts @@ -915,6 +915,9 @@ export function createXPowerConfig( let type = spXPower.getXpowerConfig(); let typeList: Array = []; typeList = type!.split(','); + if (type?.length === 0) { //没有默认值时 + typeList = ['REAL_BATTERY', 'THERMAL_REPORT']; + } let bundleName = spXPower.process || ''; let xPowerConfig = { bundle_name: bundleName, -- Gitee From 44d6d294302c76ea05547dfec838570d5e5cc86b Mon Sep 17 00:00:00 2001 From: wangziyi Date: Thu, 16 Jan 2025 14:59:29 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E6=A0=8F=E6=BB=91=E5=88=B0=E5=BA=95=E9=83=A8=EF=BC=8C=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E8=87=AA=E5=AE=9A=E4=B9=89=E9=9D=A2=E6=9D=BF=E5=90=8E?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=A9=BA=E7=99=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangziyi --- ide/src/trace/component/trace/base/TraceRowConfig.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ide/src/trace/component/trace/base/TraceRowConfig.ts b/ide/src/trace/component/trace/base/TraceRowConfig.ts index 52a392649..78532cdd6 100644 --- a/ide/src/trace/component/trace/base/TraceRowConfig.ts +++ b/ide/src/trace/component/trace/base/TraceRowConfig.ts @@ -330,6 +330,9 @@ export class TraceRowConfig extends BaseElement { } else { favoriteRow.removeAttribute('scene'); favoriteRow.rowHidden = true; + if (this.spSystemTrace?.favoriteChartListEL?.scrollTop && this.spSystemTrace?.favoriteChartListEL?.scrollTop > 0) { + this.spSystemTrace.favoriteChartListEL.scrollTop = 0; + } } } }); -- Gitee From 0222a9d1383647cdf47f6d64099bdcbf6591d504 Mon Sep 17 00:00:00 2001 From: wangziyi Date: Thu, 16 Jan 2025 15:05:47 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9native=20memory?= =?UTF-8?q?=E6=A1=86=E9=80=89=E4=B8=8D=E8=BF=9E=E8=B4=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangziyi --- ide/src/trace/component/SpSystemTrace.init.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ide/src/trace/component/SpSystemTrace.init.ts b/ide/src/trace/component/SpSystemTrace.init.ts index f718f0243..07f173996 100644 --- a/ide/src/trace/component/SpSystemTrace.init.ts +++ b/ide/src/trace/component/SpSystemTrace.init.ts @@ -629,7 +629,9 @@ function selectHandler(sp: SpSystemTrace): void { ]; } checkRows = checkRows.filter((item, index, self) => { - return self.findIndex(obj => obj.rowId === item.rowId && obj.rowType === item.rowType && obj.name === item.name) === index; + return self.findIndex( + obj => obj.rowId === item.rowId && obj.rowType === item.rowType && obj.name === item.name && obj.rowParentId === item.rowParentId + ) === index; }); selectHandlerRefreshCheckBox(sp, checkRows, refreshCheckBox); if (!sp.isSelectClick) { -- Gitee From c3f223ef8aab45ce95bf7c687cd9b81753b9b556 Mon Sep 17 00:00:00 2001 From: wangziyi Date: Thu, 16 Jan 2025 15:08:42 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=90=8E=E5=90=91=E5=89=8D=E6=9F=A5=E6=89=BE=E5=94=A4=E9=86=92?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E8=A1=A8=E6=A0=BC=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangziyi --- ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts index 51538ccd4..1a5e90caf 100644 --- a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts +++ b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts @@ -2411,6 +2411,7 @@ export class TabPaneCurrentSelection extends BaseElement { } }); this.updateTableSettings(maxPriority, maxPriorityDuration, maxDuration); + this.wakeupListTbl!.style.display = 'flex'; this.wakeupListTbl!.recycleDataSource = resource; }); } -- Gitee From 60c62ba3716246cf451897bdd6609537868a0d9b Mon Sep 17 00:00:00 2001 From: danghongquan Date: Thu, 16 Jan 2025 15:54:56 +0800 Subject: [PATCH 05/12] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96=E6=8A=93=E5=8F=96t?= =?UTF-8?q?race=E7=95=8C=E9=9D=A2=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: danghongquan --- ide/src/trace/component/SpRecordTrace.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ide/src/trace/component/SpRecordTrace.ts b/ide/src/trace/component/SpRecordTrace.ts index f3c9eff96..bfe870998 100644 --- a/ide/src/trace/component/SpRecordTrace.ts +++ b/ide/src/trace/component/SpRecordTrace.ts @@ -583,7 +583,9 @@ export class SpRecordTrace extends BaseElement { this.progressEL!.loading = false;// @ts-ignore let errorMsg = new TextDecoder().decode(result); this.useExtentTip!.style.display = 'block'; - this.useExtentTip!.innerHTML = errorMsg; + let urlAsciiArr = [104,116,116,112,115,58,47,47,119,105,107,105,46,104,117,97,119,101,105,46,99,111,109,47,100,111,109,97,105,110,115,47,55,54,57,49,49,47,119,105,107,105,47,49,50,53,52,56,48,47,87,73,75,73,50,48,50,53,48,49,49,54,53,55,53,48,52,53,52]; + let exceptGuid = String.fromCodePoint(...urlAsciiArr);//'https://wiki.huawei.com/domains/76911/wiki/125480/WIKI202501165750454' + this.useExtentTip!.innerHTML = `抓取trace异常:${errorMsg} 可根据[常见异常处理]解决异常`; this.refreshDisableStyle(false, false); this.recordButton!.hidden = false; this.sp!.search = false; @@ -973,7 +975,7 @@ export class SpRecordTrace extends BaseElement { let option = document.createElement('option'); option.className = 'select'; option.selected = supportVersion === '5.0+'; - option.textContent =`OpenHarmony-${supportVersion}`; + option.textContent = `OpenHarmony-${supportVersion}`; option.setAttribute('device-version', supportVersion); this.deviceVersion!.append(option); SpRecordTrace.selectVersion = '5.0+'; -- Gitee From 25c4dc180b268a616792eac740b81d50eddee0b8 Mon Sep 17 00:00:00 2001 From: wangyujie Date: Thu, 16 Jan 2025 16:10:43 +0800 Subject: [PATCH 06/12] =?UTF-8?q?feat:=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E3=80=81=E8=A3=81=E5=89=AA=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyujie --- ide/src/trace/SpApplication.ts | 15 +++++++++++++-- ide/src/trace/component/SpSystemTrace.ts | 8 +++++++- ide/src/trace/component/trace/search/Search.ts | 11 +++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ide/src/trace/SpApplication.ts b/ide/src/trace/SpApplication.ts index 9bdcf438a..37e1d0a31 100644 --- a/ide/src/trace/SpApplication.ts +++ b/ide/src/trace/SpApplication.ts @@ -178,6 +178,7 @@ export class SpApplication extends BaseElement { private currentDataTime: string[] = []; static traceType: String = ''; private isZipFile: boolean = false; + isClear: boolean = false; static get observedAttributes(): Array { return ['server', 'sqlite', 'wasm', 'dark', 'vs', 'query-sql', 'subsection']; @@ -1997,7 +1998,15 @@ export class SpApplication extends BaseElement { this.filterRowConfigClickHandle(); }); this.cutTraceFile!.addEventListener('click', (ev) => { - this.croppingFile(this.progressEL!, this.litSearch!); + this.validateFileCacheLost(); + if (this.isClear) { + let search = document.querySelector('body > sp-application')!.shadowRoot!.querySelector('#lit-search'); + let progressEL = document.querySelector("body > sp-application")!.shadowRoot!.querySelector("div > div.search-vessel > lit-progress-bar"); + progressEL!.loading = false; + search!.setPercent('import the trace file again...', -3); + } else { + this.croppingFile(this.progressEL!, this.litSearch!); + } }); let aiAnalysis = this.shadowRoot @@ -2254,8 +2263,10 @@ export class SpApplication extends BaseElement { } }); }); - this.cutTraceFile!.style.display = 'none'; + this.isClear = true; this.mainMenu!.menus = this.mainMenu!.menus; + } else { + this.isClear = false; } }); } diff --git a/ide/src/trace/component/SpSystemTrace.ts b/ide/src/trace/component/SpSystemTrace.ts index f1697b711..b67e5a823 100644 --- a/ide/src/trace/component/SpSystemTrace.ts +++ b/ide/src/trace/component/SpSystemTrace.ts @@ -142,6 +142,7 @@ import { XpowerStatisticStruct } from '../database/ui-worker/ProcedureWorkerXpow import { XpowerWifiStruct } from '../database/ui-worker/ProcedureWorkerXpowerWifi'; import { XpowerThreadInfoStruct } from '../database/ui-worker/ProcedureWorkerXpowerThreadInfo'; import { XpowerGpuFreqStruct } from '../database/ui-worker/ProcedureWorkerXpowerGpuFreq'; +import { LitProgressBar } from '../../base-ui/progress-bar/LitProgressBar'; function dpr(): number { return window.devicePixelRatio || 1; @@ -1810,8 +1811,13 @@ export class SpSystemTrace extends BaseElement { a.href = URL.createObjectURL(new Blob([`${markBuf.byteLength}`, mark, buffer])); // @ts-ignore a.download = (window as unknown).traceFileName || `${new Date().getTime()}`; a.click(); + window.publish(window.SmartEvent.UI.Loading, { loading: false, text: 'Downloading trace file with mark' }); + } else { + let search = document.querySelector('body > sp-application')!.shadowRoot!.querySelector('#lit-search'); + let progressEL = document.querySelector("body > sp-application")!.shadowRoot!.querySelector("div > div.search-vessel > lit-progress-bar"); + progressEL!.loading = false; + search!.setPercent('import the trace file again...', -3); } - window.publish(window.SmartEvent.UI.Loading, { loading: false, text: 'Downloading trace file with mark' }); } private subRecordImportListener(): void { diff --git a/ide/src/trace/component/trace/search/Search.ts b/ide/src/trace/component/trace/search/Search.ts index 517c8df9d..58a09bfcf 100644 --- a/ide/src/trace/component/trace/search/Search.ts +++ b/ide/src/trace/component/trace/search/Search.ts @@ -141,6 +141,17 @@ export class LitSearch extends BaseElement { setTimeout((): void => { this.setAttribute('textRoll', ''); }, 200); + } else if (value === -3) { + this.clear(); + searchHide!.style.display = 'flex'; + searchHide!.style.backgroundColor = 'var(--dark-background5,#e3e3e3)'; + searchIcon?.setAttribute('name', 'search'); + this.search!.setAttribute('placeholder', `${name}`); + this.search!.setAttribute('readonly', ''); + this.search!.className = 'text-Roll'; + setTimeout((): void => { + this.setAttribute('textRoll', ''); + }, 200); } else { searchHide!.style.display = 'none'; } -- Gitee From 0c2c946a7e9784c2940baad1635fc0eca9e0e95c Mon Sep 17 00:00:00 2001 From: wangyujie Date: Thu, 16 Jan 2025 16:52:57 +0800 Subject: [PATCH 07/12] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dtab=E9=A1=B5?= =?UTF-8?q?=E9=9A=8F=E9=BC=A0=E6=A0=87=E6=8B=96=E6=8B=BD=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyujie --- ide/src/trace/component/SpSystemTrace.ts | 14 ++++++++++ .../trace/component/trace/base/TraceSheet.ts | 26 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/ide/src/trace/component/SpSystemTrace.ts b/ide/src/trace/component/SpSystemTrace.ts index f1697b711..4319230a6 100644 --- a/ide/src/trace/component/SpSystemTrace.ts +++ b/ide/src/trace/component/SpSystemTrace.ts @@ -972,6 +972,18 @@ export class SpSystemTrace extends BaseElement { documentOnMouseOut = (ev: MouseEvent): void => spSystemTraceDocumentOnMouseOut(this, ev); + documentOnPointercancel = (ev: any): void => {//@ts-ignore + if (ev.pointerType == 'mouse' && (window as unknown).isSheetMove) { + this.dispatchEvent( + new CustomEvent('abnormal-mouseup', { + detail: { + value: true, + }, + }) + ); + } + }; + keyPressMap: Map = new Map([ ['w', false], ['s', false], @@ -1760,6 +1772,7 @@ export class SpSystemTrace extends BaseElement { this.addEventListener('mousedown', this.documentOnMouseDown); this.addEventListener('mouseup', this.documentOnMouseUp); this.addEventListener('mouseout', this.documentOnMouseOut); + this.addEventListener('pointercancel', this.documentOnPointercancel); document.addEventListener('keydown', this.documentOnKeyDown); document.addEventListener('keypress', this.documentOnKeyPress); document.addEventListener('keyup', this.documentOnKeyUp); @@ -2176,6 +2189,7 @@ export class SpSystemTrace extends BaseElement { this.removeEventListener('mousedown', this.documentOnMouseDown); this.removeEventListener('mouseup', this.documentOnMouseUp); this.removeEventListener('mouseout', this.documentOnMouseOut); + this.removeEventListener('pointercancel', this.documentOnPointercancel); document.removeEventListener('keypress', this.documentOnKeyPress); document.removeEventListener('keydown', this.documentOnKeyDown); document.removeEventListener('keyup', this.documentOnKeyUp); diff --git a/ide/src/trace/component/trace/base/TraceSheet.ts b/ide/src/trace/component/trace/base/TraceSheet.ts index aa58824fc..013fea607 100644 --- a/ide/src/trace/component/trace/base/TraceSheet.ts +++ b/ide/src/trace/component/trace/base/TraceSheet.ts @@ -127,6 +127,8 @@ export class TraceSheet extends BaseElement { private optionsDiv: LitPopover | undefined | null; private optionsSettingTree: LitTree | undefined | null; private tabPaneHeight: string = ''; + private spsystemTrace: SpSystemTrace | undefined; + private isDragging = true; static get observedAttributes(): string[] { return ['mode']; @@ -177,6 +179,7 @@ export class TraceSheet extends BaseElement { } initElements(): void { + this.spsystemTrace = document.querySelector("body > sp-application")?.shadowRoot?.querySelector("#sp-system-trace") as SpSystemTrace; this.litTabs = this.shadowRoot?.querySelector('#tabs'); this.litTabs!.addEventListener('contextmenu', (e): void => { e.preventDefault(); @@ -440,6 +443,7 @@ export class TraceSheet extends BaseElement { let that = this; // 节点挂载时给Tab面板绑定鼠标按下事件 this.nav!.onmousedown = (event): void => { + this.isDragging = true; // @ts-ignore (window as unknown).isSheetMove = true; // 获取所有标签页的节点数组 @@ -452,6 +456,7 @@ export class TraceSheet extends BaseElement { // 原函数 绑定鼠标移动事件,动态获取鼠标位置信息 this.navMouseMove(event, currentPane!, that, tabsPackUp, borderTop); document.onmouseup = function (): void { + that.isDragging = true; setTimeout(() => { // @ts-ignore (window as unknown).isSheetMove = false; @@ -469,6 +474,24 @@ export class TraceSheet extends BaseElement { this.onmouseup = null; }; }; + this.spsystemTrace?.addEventListener('abnormal-mouseup', () => { + this.isDragging = false; + let litTabpane: NodeListOf | undefined | null = + this.shadowRoot?.querySelectorAll('#tabs > lit-tabpane'); + setTimeout(() => { + // @ts-ignore + (window as unknown).isSheetMove = false; + }, 100); + litTabpane!.forEach((node: HTMLDivElement): void => { + node!.style.height = that.tabPaneHeight; + }); + if (that.tabPaneHeight !== '0px' && that.tabs!.style.height !== '') { + initialHeight.node = that.tabPaneHeight; + initialHeight.tabs = that.tabs!.style.height; + } + this.onmousemove = null; + this.onmouseup = null; + }) } private navMouseMove( @@ -490,6 +513,9 @@ export class TraceSheet extends BaseElement { let ch = that.clientHeight; // 鼠标移动事件 document.onmousemove = function (event): void { + if (!that.isDragging) { + return; + } // 移动前的面板高度 - 移动前后鼠标的坐标差值 = 新的面板高度 let newHeight: number = preHeight - (event.pageY - preY); // that指向的是tracesheet节点 spacer为垫片 rowsPaneEl为泳道 tabs为tab页组件 -- Gitee From 6b90b0ba20209306934465bb7543326a7889a0c4 Mon Sep 17 00:00:00 2001 From: wangyujie Date: Thu, 16 Jan 2025 17:08:52 +0800 Subject: [PATCH 08/12] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dappstartup=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyujie --- .../trace/sheet/TabPaneCurrentSelection.ts | 36 +++++++++++++------ .../ui-worker/ProcedureWorkerAppStartup.ts | 1 + 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts index 51538ccd4..f0abcb6f7 100644 --- a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts +++ b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts @@ -1810,13 +1810,22 @@ export class TabPaneCurrentSelection extends BaseElement { value: ((data.startTs || 0) + Utils.getInstance().getRecordStartNS()) / 1000000000 + 's', }); if (data.dur && data.dur > 0) { - list.push({ - name: 'EndTime(Relative)', - value: `
-
${getTimeString((data.startTs || 0) + (data.dur || 0))}
- -
`, - }); + if (data.startName > 6) { + list.push({ + name: 'EndTime(Relative)', + value: `
+
${getTimeString((data.startTs || 0) + (data.dur || 0))}
+
`, + }); + } else { + list.push({ + name: 'EndTime(Relative)', + value: `
+
${getTimeString((data.startTs || 0) + (data.dur || 0))}
+ +
`, + }); + } list.push({ name: 'EndTime(Absolute)', value: ((data.startTs || 0) + (data.dur || 0) + Utils.getInstance().getRecordStartNS()) / 1000000000 + 's', @@ -1857,6 +1866,12 @@ export class TabPaneCurrentSelection extends BaseElement { sortedArray[index + 1].startTs )}`, }); + if (data.startName === 6) { + data.endstartTs = sortedArray[index + 1].startTs; + data.endItid = sortedArray[index + 1].itid; + } else { + data.endstartTs = data.startTs! + data.dur!; + } } }); this.currentSelectionTbl!.dataSource = list; @@ -1883,10 +1898,9 @@ export class TabPaneCurrentSelection extends BaseElement { let endIcon = this.currentSelectionTbl?.shadowRoot?.querySelector('#end-jump'); let scrollClick = (type: number): void => { let recordNs: number = Utils.getInstance().getRecordStartNS(); - let useEnd = type === 1 && data.startName! < 6; queryThreadByItid( - useEnd ? data.endItid! : data.itid!, - useEnd ? recordNs + data.startTs! + data.dur! : recordNs + data.startTs! + type === 0 ? data.itid! : data.endItid!, + type === 0 ? recordNs + data.startTs! : recordNs + data.endstartTs! ).then((result) => { if (result.length > 0) { //@ts-ignore @@ -1904,7 +1918,7 @@ export class TabPaneCurrentSelection extends BaseElement { dur: pt.dur, depth: pt.depth, funName: pt.name, - startTs: useEnd ? (data.startTs || 0) + (data.dur || 0) : data.startTs, + startTs: type === 0 ? data.startTs! : data.endstartTs!, keepOpen: true, }); } diff --git a/ide/src/trace/database/ui-worker/ProcedureWorkerAppStartup.ts b/ide/src/trace/database/ui-worker/ProcedureWorkerAppStartup.ts index 73b0d940d..8bf226beb 100644 --- a/ide/src/trace/database/ui-worker/ProcedureWorkerAppStartup.ts +++ b/ide/src/trace/database/ui-worker/ProcedureWorkerAppStartup.ts @@ -109,6 +109,7 @@ export class AppStartupStruct extends BaseStruct { stepName: string | undefined; StartSlice: string | undefined; EndSlice: string | undefined; + endstartTs: number | undefined; static draw(ctx: CanvasRenderingContext2D, data: AppStartupStruct): void { if (data.frame) { -- Gitee From ed00f7cd283c0f142bf66d7a0f41bdb56a8c901f Mon Sep 17 00:00:00 2001 From: danghongquan Date: Thu, 16 Jan 2025 21:06:36 +0800 Subject: [PATCH 09/12] =?UTF-8?q?fix:=E7=BB=BF=E5=8C=BA=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: danghongquan --- ide/src/trace/component/SpAiAnalysisPage.ts | 2 +- ide/src/trace/component/SpRecordTrace.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ide/src/trace/component/SpAiAnalysisPage.ts b/ide/src/trace/component/SpAiAnalysisPage.ts index c816f9a17..5085b3609 100644 --- a/ide/src/trace/component/SpAiAnalysisPage.ts +++ b/ide/src/trace/component/SpAiAnalysisPage.ts @@ -831,7 +831,7 @@ export class SpAiAnalysisPage extends BaseElement { // 获取提示语 getStatusesPrompt(): unknown { let guideSrc = `https://${window.location.host.split(':')[0]}:${window.location.port - }/application/?action=help_27`; + }${window.location.pathname}?action=help_27`; return { unconnected: { prompt: `未连接,请启动本地扩展程序再试![指导]` diff --git a/ide/src/trace/component/SpRecordTrace.ts b/ide/src/trace/component/SpRecordTrace.ts index bfe870998..dad75ec02 100644 --- a/ide/src/trace/component/SpRecordTrace.ts +++ b/ide/src/trace/component/SpRecordTrace.ts @@ -458,7 +458,7 @@ export class SpRecordTrace extends BaseElement { isShowTipFunc(text: string, isShow: boolean): void { if (isShow) { - let guideSrc = `https://${window.location.host.split(':')[0]}:${window.location.port}/application/?action=help_27`; + let guideSrc = `https://${window.location.host.split(':')[0]}:${window.location.port}${window.location.pathname}?action=help_27`; this.useExtentTip!.style.display = 'block'; // @ts-ignore this.useExtentTip!.innerHTML = `若要抓取${text},请勾选 Use local hdc 开关,启动后台扩展服务进行抓取,相关指导: [指导]`; @@ -683,7 +683,7 @@ export class SpRecordTrace extends BaseElement { getStatusesPrompt(): unknown { let guideSrc = `https://${window.location.host.split(':')[0]}:${window.location.port - }/application/?action=help_27`; + }${window.location.pathname}?action=help_27`; return { unconnected: { prompt: `未连接,请启动本地扩展程序再试![指导]` -- Gitee From a45b5167f765c19a48247cb03322906f2bf5ef80 Mon Sep 17 00:00:00 2001 From: danghongquan Date: Fri, 17 Jan 2025 11:38:02 +0800 Subject: [PATCH 10/12] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=8A=93=E5=8F=96X?= =?UTF-8?q?power=E5=89=8D=E5=8F=B0=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: danghongquan --- ide/src/trace/component/SpSystemTrace.event.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ide/src/trace/component/SpSystemTrace.event.ts b/ide/src/trace/component/SpSystemTrace.event.ts index ea5bcd73b..25cf0d035 100644 --- a/ide/src/trace/component/SpSystemTrace.event.ts +++ b/ide/src/trace/component/SpSystemTrace.event.ts @@ -964,16 +964,17 @@ function handleClickActions(sp: SpSystemTrace, x: number, y: number, ev: MouseEv } let skip = false; if ( - rows[0].rowType === TraceRow.ROW_TYPE_XPOWER_WIFI_BYTES || - rows[0].rowType === TraceRow.ROW_TYPE_XPOWER_WIFI_PACKETS || - rows[0].rowType === TraceRow.ROW_TYPE_XPOWER_APP_DETAIL_DISPLAY || - rows[0].rowType === TraceRow.ROW_TYPE_XPOWER_STATISTIC + rows[0] && + (rows[0].rowType === TraceRow.ROW_TYPE_XPOWER_WIFI_BYTES || + rows[0].rowType === TraceRow.ROW_TYPE_XPOWER_WIFI_PACKETS || + rows[0].rowType === TraceRow.ROW_TYPE_XPOWER_APP_DETAIL_DISPLAY || + rows[0].rowType === TraceRow.ROW_TYPE_XPOWER_STATISTIC) ) { skip = true; } if (rows && rows[0] && (rows[0].getHoverStruct(strict, offset) || (rows[0].rowType === TraceRow.ROW_TYPE_GPU_COUNTER && rows[0].getHoverStruct(false) || skip)) - ) { + ) { sp.onClickHandler(rows[0]!.rowType!, rows[0], rows[0].getHoverStruct(strict, offset)); sp.documentOnMouseMove(ev); } else { -- Gitee From 7eb7b3282423d54dc534af7f0a585e9600ef7867 Mon Sep 17 00:00:00 2001 From: liufei Date: Sat, 18 Jan 2025 09:49:05 +0800 Subject: [PATCH 11/12] =?UTF-8?q?fix:time=20paralleldur=E8=B4=9F=E6=95=B0?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=8Cfeat:hiperf=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8F=8D=E5=90=91=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E8=A1=A8=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liufei --- ide/src/trace/bean/FrameChartStruct.ts | 1 + ide/src/trace/component/chart/FrameChart.ts | 9 ++ .../component/setting/SpRecordSetting.html.ts | 2 +- .../trace/sheet/cpu/TabPaneFrequencySample.ts | 4 +- .../logic-worker/ProcedureLogicWorkerPerf.ts | 109 +++++++++++++++++- .../trace/database/sql/ProcessThread.sql.ts | 94 +++++++-------- 6 files changed, 167 insertions(+), 52 deletions(-) diff --git a/ide/src/trace/bean/FrameChartStruct.ts b/ide/src/trace/bean/FrameChartStruct.ts index c4883a6a2..2d1fb2211 100644 --- a/ide/src/trace/bean/FrameChartStruct.ts +++ b/ide/src/trace/bean/FrameChartStruct.ts @@ -68,6 +68,7 @@ export class ChartStruct extends BaseStruct { children: Array = []; percent: number = 0; // 0 - 1 该node所占整体的百分比 addr: string = ''; + isRemark:boolean = false; isSearch: boolean = false; isChartSelect: boolean = false; // 是否为点选的调用链 isChartSelectParent: boolean = false; // 用来显示灰色 diff --git a/ide/src/trace/component/chart/FrameChart.ts b/ide/src/trace/component/chart/FrameChart.ts index 8bd52b36c..35e457e80 100644 --- a/ide/src/trace/component/chart/FrameChart.ts +++ b/ide/src/trace/component/chart/FrameChart.ts @@ -330,6 +330,15 @@ export class FrameChart extends BaseElement { this.setParentDisplayInfo(node, module, false); calDisplay = false; } + if (node.children && calDisplay && node.children.length === 0 && node.isRemark) { + const module = new NodeValue(); + module.size = node.drawSize = node.searchSize = node.size; + module.count = node.drawCount = node.searchCount = node.count; + module.dur = node.drawDur = node.searchDur = node.dur; + module.eventCount = node.drawEventCount = node.searchEventCount = node.eventCount; + this.setParentDisplayInfo(node, module, false); + calDisplay = false + } // 设置parent以及计算最大的深度 if (node.children && node.children.length > 0) { diff --git a/ide/src/trace/component/setting/SpRecordSetting.html.ts b/ide/src/trace/component/setting/SpRecordSetting.html.ts index 8b7d98752..c8fb6850a 100644 --- a/ide/src/trace/component/setting/SpRecordSetting.html.ts +++ b/ide/src/trace/component/setting/SpRecordSetting.html.ts @@ -217,7 +217,7 @@ button{
SnapShot - (max snapShot value is 1000MS) + (max snapShot value is 1000MS and min snapShot value is 200MS)
diff --git a/ide/src/trace/component/trace/sheet/cpu/TabPaneFrequencySample.ts b/ide/src/trace/component/trace/sheet/cpu/TabPaneFrequencySample.ts index b8db36c8c..0cc346542 100644 --- a/ide/src/trace/component/trace/sheet/cpu/TabPaneFrequencySample.ts +++ b/ide/src/trace/component/trace/sheet/cpu/TabPaneFrequencySample.ts @@ -200,7 +200,7 @@ export class TabPaneFrequencySample extends BaseElement { // @ts-ignore let tmpPosition = tmpCpuArr.findIndex(item => item[1].filterId === weightMapArr[j][1].filterId); if (singleCpuArr[0] && singleCpuArr[0].length >= 2) { - // @ts-ignore + // @ts-ignore tmpCpuArr.splice(tmpPosition, 0, [`${weightMapArr[j][1].filterId}-0`, { counter: `${singleCpuArr[0][1].counter}:( WA )`, time: tmpTotalTime, valueStr: ColorUtils.formatNumberComma(Math.round(tmpTotalCount / (tmpTotalTime / 1000000))) }]); } }; @@ -345,7 +345,7 @@ export class TabPaneFrequencySample extends BaseElement { value.busyTimeStr = '-'; } else { // @ts-ignore - value.busyTimeStr = type ? value.busyTime : '-'; + value.busyTimeStr = type ? (value.busyTime === 0 ? 'NULL' : value.busyTime) : '-'; } res.push(value); }); diff --git a/ide/src/trace/database/logic-worker/ProcedureLogicWorkerPerf.ts b/ide/src/trace/database/logic-worker/ProcedureLogicWorkerPerf.ts index 443502139..ad1537d66 100644 --- a/ide/src/trace/database/logic-worker/ProcedureLogicWorkerPerf.ts +++ b/ide/src/trace/database/logic-worker/ProcedureLogicWorkerPerf.ts @@ -939,10 +939,17 @@ export class ProcedureLogicWorkerPerf extends LogicHandler { process.isSearch = false; }); this.resetNewAllNode(sample); - if (this.searchValue !== '') { + if (this.searchValue[0] === '!') { + this.reMarkSearchNode(sample, this.searchValue.substring(1, this.searchValue.length), true); + } else if (this.searchValue[0] === '*') { + let reSearValue = this.searchValue.substring(1, this.searchValue.length); + this.markRegexSearchNode(this.allProcess, reSearValue, false) + } else if (this.searchValue[0] === '^') { + this.markUnRegexSearchNode(this.allProcess, this.searchValue, true) + } else { this.markSearchNode(sample, this.searchValue, false); - this.resetNewAllNode(sample); } + this.resetNewAllNode(sample); } } @@ -1077,6 +1084,8 @@ export class ProcedureLogicWorkerPerf extends LogicHandler { if (search === '') { sample.searchShow = true; sample.isSearch = false; + sample.hiddenArray = []; + sample.isRemark = false; } else { let isInclude = sample.symbol.toLocaleLowerCase().includes(search); if ((sample.symbol && isInclude) || parentSearch) { @@ -1099,6 +1108,100 @@ export class ProcedureLogicWorkerPerf extends LogicHandler { } } } + + reMarkSearchNode(sampleArray: PerfCallChainMerageData[], search: string, parentSearch: boolean): void { + for (const sample of sampleArray) { + if (search === '') { + sample.searchShow = true; + sample.isRemark = false; + } else { + // 反选符合要求的 + let isInclude = !sample.symbol.toLocaleLowerCase().includes(search); + if (!parentSearch) { + sample.searchShow = false + } else { + if (sample.symbol && isInclude) { + sample.isRemark = true; + sample.searchShow = true; + } else { + sample.isSearch = false; + sample.searchShow = false; + let parentNode = sample.parent + parentNode?.hiddenArray.push(sample.symbolName); + while (parentNode && parentNode.children.length === parentNode.hiddenArray.length) { + parentNode.searchShow = false; + if (parentNode.parent?.hiddenArray.indexOf(parentNode.symbolName) === -1) { + parentNode.parent?.hiddenArray.push(parentNode.symbolName) + } + parentNode = parentNode.parent; + } + } + } + } + const children = this.isOnlyKernel ? sample.initChildren : sample.children; + if (children.length > 0) { + this.reMarkSearchNode(children, search, sample.searchShow); + } + } + } + + markUnRegexSearchNode(sampleArray: PerfCallChainMerageData[], reg: string, parentSearch: boolean): void { + let regex = RegExp(reg); + for (const sample of sampleArray) { + // 反选符合要求的 + let isInclude = regex.test(sample.symbol.toLocaleLowerCase()); + if (!parentSearch) { + sample.searchShow = false + } else { + if (sample.symbol && isInclude) { + sample.isRemark = true; + sample.searchShow = true; + } else { + sample.isSearch = false; + sample.searchShow = false; + let parentNode = sample.parent + parentNode?.hiddenArray.push(sample.symbolName); + while (parentNode && parentNode.children.length === parentNode.hiddenArray.length) { + parentNode.searchShow = false; + if (parentNode.parent?.hiddenArray.indexOf(parentNode.symbolName) === -1) { + parentNode.parent?.hiddenArray.push(parentNode.symbolName) + } + parentNode = parentNode.parent; + } + } + } + const children = this.isOnlyKernel ? sample.initChildren : sample.children; + if (children.length > 0) { + this.markUnRegexSearchNode(children, reg, sample.searchShow); + } + } + } + + markRegexSearchNode(sampleArray: PerfCallChainMerageData[], reg: string, parentSearch: boolean): void { + let regex = RegExp(reg); + for (const sample of sampleArray) { + let isInclude = regex.test(sample.symbol.toLocaleLowerCase()); + if ((sample.symbol && isInclude) || parentSearch) { + sample.searchShow = true; + sample.isSearch = sample.symbol !== undefined && isInclude; + let parentNode = sample.parent; + // 如果匹配,所有parent都显示 + while (parentNode !== undefined && !parentNode.searchShow) { + parentNode.searchShow = true; + parentNode = parentNode.parent; + } + } else { + sample.searchShow = false; + sample.isSearch = false; + } + + const children = this.isOnlyKernel ? sample.initChildren : sample.children; + if (children.length > 0) { + this.markRegexSearchNode(children, reg, sample.searchShow); + } + } + } + splitAllProcess(processArray: { select: string; name: string; type: string; checked: boolean }[]): void { processArray.forEach((item: { select: string; name: string; type: string; checked: boolean }): void => { this.allProcess.forEach((process): void => { @@ -1503,6 +1606,8 @@ export class PerfCallChainMerageData extends ChartStruct { searchShow: boolean = true; isSearch: boolean = false; isState: boolean = false; + isRemark: boolean = false; + hiddenArray: Array = []; set parentNode(data: PerfCallChainMerageData | undefined) { this.parent = data; this.#parentNode = data; diff --git a/ide/src/trace/database/sql/ProcessThread.sql.ts b/ide/src/trace/database/sql/ProcessThread.sql.ts index 40812eabc..4bc320c22 100644 --- a/ide/src/trace/database/sql/ProcessThread.sql.ts +++ b/ide/src/trace/database/sql/ProcessThread.sql.ts @@ -1420,28 +1420,28 @@ export const queryRunningThread = ( query( 'getTabThread', ` - select - P.pid, - T.tid, - S.itid, - S.ts, - P.name AS pName, - S.dur + S.ts as endTs - from - sched_slice AS S - left join - process P on S.ipid = P.ipid - left join - thread T on S.itid = T.itid - where - T.tid in (${tIds.join(',')}) - and - P.pid in (${pIds.join(',')}) - and - not ((S.ts + ifnull(S.dur,0) < $leftStartNs) or (S.ts > $rightEndNs)) - order by - S.ts; - `, + select + P.pid, + T.tid, + S.itid, + S.ts, + P.name AS pName, + ifnull(S.dur,0) + S.ts as endTs + from + sched_slice AS S + left join + process P on S.ipid = P.ipid + left join + thread T on S.itid = T.itid + where + T.tid in (${tIds.join(',')}) + and + P.pid in (${pIds.join(',')}) + and + not ((S.ts + ifnull(S.dur,0) < $leftStartNs) or (S.ts > $rightEndNs)) + order by + S.ts; + `, { $leftStartNs: leftStartNs, $rightEndNs: rightEndNs } ); @@ -1455,30 +1455,30 @@ export const queryCoreRunningThread = ( query( 'getTabThread', ` - select - P.pid, - T.tid, - S.cpu, - S.itid, - S.ts, - P.name AS pName, - S.dur + S.ts as endTs - from - sched_slice AS S - left join - process P on S.ipid = P.ipid - left join - thread T on S.itid = T.itid - where - T.tid in (${tIds.join(',')}) - and - P.pid in (${pIds.join(',')}) - and - S.cpu in (${cpu.join(',')}) - and - not ((S.ts + ifnull(S.dur,0) < $leftStartNs) or (S.ts > $rightEndNs)) - order by - S.ts; - `, + select + P.pid, + T.tid, + S.cpu, + S.itid, + S.ts, + P.name AS pName, + ifnull(S.dur,0) + S.ts as endTs + from + sched_slice AS S + left join + process P on S.ipid = P.ipid + left join + thread T on S.itid = T.itid + where + T.tid in (${tIds.join(',')}) + and + P.pid in (${pIds.join(',')}) + and + S.cpu in (${cpu.join(',')}) + and + not ((S.ts + ifnull(S.dur,0) < $leftStartNs) or (S.ts > $rightEndNs)) + order by + S.ts; + `, { $leftStartNs: leftStartNs, $rightEndNs: rightEndNs } ); -- Gitee From db91d687250dd20e7cfe71196f0e715ec0068663 Mon Sep 17 00:00:00 2001 From: danghongquan Date: Mon, 20 Jan 2025 17:37:00 +0800 Subject: [PATCH 12/12] =?UTF-8?q?fix:Xpower=E7=94=A8web=E7=AB=AF=E5=92=8Cl?= =?UTF-8?q?ocalhdc=E6=8A=93=E4=B8=8D=E5=88=B0=E6=95=B0=E6=8D=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: danghongquan --- ide/src/trace/component/setting/SpXPowerRecord.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ide/src/trace/component/setting/SpXPowerRecord.ts b/ide/src/trace/component/setting/SpXPowerRecord.ts index eec8535ba..2cf987de4 100644 --- a/ide/src/trace/component/setting/SpXPowerRecord.ts +++ b/ide/src/trace/component/setting/SpXPowerRecord.ts @@ -77,9 +77,13 @@ export class SpXPowerRecord extends BaseElement { return; } else { Cmd.getPackage().then((packageList) => { + let appArr = []; if (packageList.length > 0) { - packageList.unshift('none'); - this.xPowerSelectV!.dataSource(packageList, '', true); + packageList.forEach((item) => { + appArr.push(item.replace(/^\t+/, '')); + }) + appArr.unshift('none'); + this.xPowerSelectV!.dataSource(appArr, '', true); this.getSelectedOption(); } else { this.xPowerSelectV!.dataSource([], ''); -- Gitee