diff --git a/ide/src/base-ui/menu/LitMainMenu.ts b/ide/src/base-ui/menu/LitMainMenu.ts
index 8c3d7cbdff0cbe27148f68a20da01cacff4313f5..7892272e01349d31d37cedfba3bc5d34b0c15eaa 100644
--- a/ide/src/base-ui/menu/LitMainMenu.ts
+++ b/ide/src/base-ui/menu/LitMainMenu.ts
@@ -44,7 +44,12 @@ export class LitMainMenu extends BaseElement {
value?.forEach((it) => {
let group = new LitMainMenuGroup();
group.setAttribute('title', it.title || '');
- group.setAttribute('describe', it.describe || '');
+ if (it.describe !== '') {
+ group.setAttribute('describe', it.describe || '');
+ } else {
+ group.removeAttribute('describe');
+ }
+ group.setAttribute('icon', it.icon || '');
if (it.collapsed) {
group.setAttribute('collapsed', '');
} else {
@@ -57,7 +62,12 @@ export class LitMainMenu extends BaseElement {
if (item.children && item.children.length > 0) {
let secondGroup = new LitMainMenuGroup();
secondGroup.setAttribute('title', item.title || '');
- secondGroup.setAttribute('describe', item.describe || '');
+ if (item.describe !== '') {
+ secondGroup.setAttribute('describe', item.describe || '');
+ } else {
+ secondGroup.removeAttribute('describe');
+ }
+ secondGroup.setAttribute('icon', item.icon || '');
if (item.second) {
secondGroup.setAttribute('second', '');
} else {
@@ -245,6 +255,7 @@ export interface MenuGroup {
second: boolean;
collapsed: boolean;
children: any;
+ icon: string;
}
export interface MenuItem {
diff --git a/ide/src/base-ui/menu/LitMainMenuGroup.ts b/ide/src/base-ui/menu/LitMainMenuGroup.ts
index b9d0fbedf3a1e85c64f64763ef38dd5816aff85c..869978b0958b4b9252f62bb0946ab5d95e991a2d 100644
--- a/ide/src/base-ui/menu/LitMainMenuGroup.ts
+++ b/ide/src/base-ui/menu/LitMainMenuGroup.ts
@@ -21,9 +21,10 @@ export class LitMainMenuGroup extends BaseElement {
private groupNameEl: HTMLElement | null | undefined;
private groupDescEl: HTMLElement | null | undefined;
private group: HTMLElement | null | undefined;
+ private iconEl: HTMLElement | null | undefined;
static get observedAttributes() {
- return ['title', 'describe', 'collapsed', 'nocollapse', 'radius', 'second'];
+ return ['title', 'describe', 'collapsed', 'nocollapse', 'radius', 'second', 'icon'];
}
get second() {
@@ -67,8 +68,9 @@ export class LitMainMenuGroup extends BaseElement {
}
initElements(): void {
- this.groupNameEl = this.shadowRoot?.querySelector('.group-name');
+ this.groupNameEl = this.shadowRoot?.querySelector('.group-title');
this.groupDescEl = this.shadowRoot?.querySelector('.group-describe');
+ this.iconEl = this.shadowRoot?.querySelector('.icon');
this.group = this.shadowRoot?.querySelector('#group');
this.group!.addEventListener('click', (e) => {
if (this.nocollapsed) {
@@ -104,6 +106,7 @@ export class LitMainMenuGroup extends BaseElement {
:host(:not([collapsed])) .group-describe{
height: 0;
visibility: hidden;
+ padding:0;
}
:host([collapsed]):hover){
background-color: #FFFFFF;
@@ -128,25 +131,38 @@ export class LitMainMenuGroup extends BaseElement {
:host([collapsed]) ::slotted(lit-main-menu-group){
display:none;
}
+ :host(:not([describe])) .group-describe{
+ display:none;
+ }
+ :host([describe]) .group-describe{
+ padding: 4px 24px 0 24px;
+ color: #999 !important;
+ font-size: 1rem;
+ }
+ :host([describe]) .group-name{
+ margin-top: 10px;
+ }
.group-name{
+ display:flex;
font-size: 14px;
font-family: Helvetica;
color: #000;
- padding: 20px 24px 0px 24px;
+ padding: 15px 24px 5px 10px;
line-height: 16px;
font-weight: 400;
text-align: left;
}
- .group-describe{
- color: #000;
- font-size: 0.6rem;
- padding: 4px 24px 20px 24px;
+ :host([collapsed]) .icon{
+ transform: rotateZ(-90deg);
}
-
+
`;
}
@@ -159,6 +175,9 @@ export class LitMainMenuGroup extends BaseElement {
case 'describe':
if (this.groupDescEl) this.groupDescEl.textContent = newValue;
break;
+ case 'icon':
+ if (this.iconEl) this.iconEl.setAttribute('name', newValue);
+ break;
}
}
}
diff --git a/ide/src/trace/SpApplication.ts b/ide/src/trace/SpApplication.ts
index 2881d8ae401ce27cd8ca12c297c2eb87aa66964a..b2e545d9cfbfde4a3ae9f7dbe0590a11be231644 100644
--- a/ide/src/trace/SpApplication.ts
+++ b/ide/src/trace/SpApplication.ts
@@ -1113,6 +1113,7 @@ export class SpApplication extends BaseElement {
collapsed: false,
title: 'Current Trace',
second: false,
+ icon:'',
describe: 'Actions on the current trace',
children: getTraceOptionMenus(showFileName, fileSize, fileName, true, dbName),
});
@@ -1461,6 +1462,7 @@ export class SpApplication extends BaseElement {
collapsed: false,
title: 'Convert trace',
second: false,
+ icon:'',
describe: 'Convert to other formats',
children: pushConvertTrace(fileName),
});
@@ -1470,6 +1472,7 @@ export class SpApplication extends BaseElement {
collapsed: false,
title: 'Support',
second: false,
+ icon:'',
describe: 'Support',
children: [
{
@@ -1517,6 +1520,7 @@ export class SpApplication extends BaseElement {
collapsed: false,
title: 'Current Trace',
second: false,
+ icon:'',
describe: 'Actions on the current trace',
children: getTraceOptionMenus(showFileName, fileSize, fileName, false),
});
@@ -1823,6 +1827,7 @@ export class SpApplication extends BaseElement {
collapsed: false,
title: 'Current Trace',
second: false,
+ icon:'',
describe: 'Actions on the current trace',
children: getTraceOptionMenus(showFileName, fileSize, fileName, false),
});
@@ -1849,6 +1854,7 @@ export class SpApplication extends BaseElement {
collapsed: false,
title: 'Navigation',
second: false,
+ icon:'',
describe: 'Open or record a new trace',
children: [
{
@@ -1908,6 +1914,7 @@ export class SpApplication extends BaseElement {
collapsed: false,
title: 'Support',
second: false,
+ icon:'',
describe: 'Support',
children: [
{
diff --git a/ide/src/trace/component/SpHelp.ts b/ide/src/trace/component/SpHelp.ts
index 4af9598eaf0a6648c17c29c181d6cddb504fe009..1ee902efacb45088cc201d8cd5f3ca71fa4b2eb6 100644
--- a/ide/src/trace/component/SpHelp.ts
+++ b/ide/src/trace/component/SpHelp.ts
@@ -55,6 +55,7 @@ export class SpHelp extends BaseElement {
collapsed: false,
title: 'QuickStart',
second: false,
+ icon:'caret-down',
describe: '',
children: [
{
@@ -62,6 +63,7 @@ export class SpHelp extends BaseElement {
title: '抓取和导入',
describe: '',
second: true,
+ icon:'caret-down',
children: [
{
title: '设备端抓取trace说明',
@@ -108,6 +110,7 @@ export class SpHelp extends BaseElement {
collapsed: false,
title: '内存',
describe: '',
+ icon:'caret-down',
second: true,
children: [
{
@@ -170,6 +173,7 @@ export class SpHelp extends BaseElement {
title: 'Native栈',
describe: '',
second: true,
+ icon:'caret-down',
children: [
{
title: 'HiPerf的抓取和展示说明',
@@ -191,6 +195,7 @@ export class SpHelp extends BaseElement {
title: 'TS栈',
describe: '',
second: true,
+ icon:'caret-down',
children: [
{
title: 'Cpuprofiler抓取和展示说明',
@@ -212,6 +217,7 @@ export class SpHelp extends BaseElement {
title: '分析模板',
describe: '',
second: true,
+ icon:'caret-down',
children: [
{
title: 'Frame timeline抓取和展示说明',
@@ -285,6 +291,7 @@ export class SpHelp extends BaseElement {
title: '文件',
describe: '',
second: true,
+ icon:'caret-down',
children: [
{
title: 'FileSystem抓取和展示说明',
@@ -319,6 +326,7 @@ export class SpHelp extends BaseElement {
title: '其他',
describe: '',
second: true,
+ icon:'caret-down',
children: [
{
title: 'Sql分析和Metrics说明',
@@ -449,6 +457,7 @@ export class SpHelp extends BaseElement {
title: 'TraceStreamer',
second: false,
describe: '',
+ icon:'caret-down',
children: [
{
title: 'TraceStreamer数据库说明',
@@ -524,6 +533,7 @@ export class SpHelp extends BaseElement {
title: 'SmartPerf',
second: false,
describe: '',
+ icon:'caret-down',
children: [
{
title: 'SmartPerf 编译指导',
diff --git a/ide/src/trace/component/chart/SpChartManager.ts b/ide/src/trace/component/chart/SpChartManager.ts
index 01cfe410f801d4247b0efcec8fa21e748852efc3..d1d824022b3adbed1b8197743401c03255cf53c3 100644
--- a/ide/src/trace/component/chart/SpChartManager.ts
+++ b/ide/src/trace/component/chart/SpChartManager.ts
@@ -51,6 +51,7 @@ import { SpLogChart } from './SpLogChart';
import { SpHiSysEventChart } from './SpHiSysEventChart';
import { SpAllAppStartupsChart } from './SpAllAppStartups';
import { setVSyncData } from './VSync';
+import { SpSegmentationChart } from './SpSegmentationChart';
export class SpChartManager {
static APP_STARTUP_PID_ARR: Array = [];
@@ -75,6 +76,7 @@ export class SpChartManager {
public arkTsChart: SpArkTsChart;
private logChart: SpLogChart;
private spHiSysEvent: SpHiSysEventChart;
+ private SpSegmentationChart: SpSegmentationChart;
constructor(trace: SpSystemTrace) {
this.trace = trace;
@@ -97,6 +99,7 @@ export class SpChartManager {
this.logChart = new SpLogChart(trace);
this.spHiSysEvent = new SpHiSysEventChart(trace);
this.spAllAppStartupsChart = new SpAllAppStartupsChart(trace);
+ this.SpSegmentationChart = new SpSegmentationChart(trace);
}
async init(progress: Function) {
@@ -141,6 +144,8 @@ export class SpChartManager {
progress('Irq init', 84);
await this.irqChart.init();
info('Cpu Freq Data initialized');
+ progress('SpSegmentationChart inin', 84.5);
+ await this.SpSegmentationChart.init();
await this.virtualMemChart.init();
progress('fps', 85);
await this.fps.init();
diff --git a/ide/src/trace/component/chart/SpHiPerf.ts b/ide/src/trace/component/chart/SpHiPerf.ts
index 9b026fd1bf378fecad029d6abbc1cb7438e80052..251ebf75328623c940fa1f0e090f722fd3e4dcce 100644
--- a/ide/src/trace/component/chart/SpHiPerf.ts
+++ b/ide/src/trace/component/chart/SpHiPerf.ts
@@ -209,6 +209,7 @@ export class SpHiPerf {
perfCallCutRow.folder = false;
perfCallCutRow.drawType = -2;
perfCallCutRow.name = 'CallChart [cpu0]';
+ perfCallCutRow.funcExpand = false;
perfCallCutRow.setAttribute('children', '');
perfCallCutRow.favoriteChangeHandler = this.trace.favoriteChangeHandler;
perfCallCutRow.selectChangeHandler = this.trace.selectChangeHandler;
diff --git a/ide/src/trace/component/chart/SpSegmentationChart.ts b/ide/src/trace/component/chart/SpSegmentationChart.ts
new file mode 100644
index 0000000000000000000000000000000000000000..13aee0ba59aa7751a74defdca719c4eb25644bd2
--- /dev/null
+++ b/ide/src/trace/component/chart/SpSegmentationChart.ts
@@ -0,0 +1,491 @@
+/*
+ * Copyright (C) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { SpSystemTrace } from '../SpSystemTrace';
+import { ColorUtils } from '../trace/base/ColorUtils';
+import { TraceRow } from '../trace/base/TraceRow';
+import { renders } from '../../database/ui-worker/ProcedureWorker';
+import { EmptyRender } from '../../database/ui-worker/ProcedureWorkerCPU';
+import { FreqExtendRender, CpuFreqExtendStruct } from '../../database/ui-worker/ProcedureWorkerFreqExtend';
+import { BinderRender, BinderStruct } from '../../database/ui-worker/procedureWorkerBinder';
+import { queryIrqList } from '../../database/SqlLite';
+import { BaseStruct } from '../../bean/BaseStruct';
+
+export class SpSegmentationChart {
+ static trace: SpSystemTrace;
+ static jsonRow: TraceRow | undefined;
+ static GpuRow: TraceRow | undefined;
+ static binderRow: TraceRow | undefined;
+ static schedRow: TraceRow | undefined;
+ static freqInfoMapData = new Map>();
+ private rowFolder!: TraceRow;
+ static chartData: Array