From bfe5abf9eaa3ca5ef79ccba50f9f89f7833d7684 Mon Sep 17 00:00:00 2001 From: zhangzepeng Date: Tue, 27 Feb 2024 17:27:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E2=80=99smartperf=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangzepeng --- .../base-ui/chart/scatter/LitChartScatter.ts | 601 ++++++++ .../chart/scatter/LitChartScatterConfig.ts | 45 + ide/src/base-ui/drawer/LitDrawer.ts | 25 +- ide/src/base-ui/modal/LitModal.ts | 572 -------- ide/src/base-ui/popover/LitPopoverV.ts | 7 +- ide/src/base-ui/select/LitAllocationSelect.ts | 7 +- ide/src/base-ui/select/LitSelectHtml.ts | 8 +- ide/src/base-ui/slider/LitSlider.ts | 9 +- ide/src/base-ui/table/LitPageTable.ts | 156 +- ide/src/base-ui/table/LitTableHtml.ts | 8 +- ide/src/base-ui/table/lit-table.ts | 145 +- ide/src/base-ui/tabs/lit-tabs.html.ts | 1 + ide/src/base-ui/utils/Template.ts | 8 + ide/src/doc/md/des_tables.md | 48 +- ide/src/doc/md/quickstart_ability_monitor.md | 6 +- ide/src/doc/md/quickstart_arkts.md | 6 +- ide/src/doc/md/quickstart_bio.md | 8 +- ide/src/doc/md/quickstart_device_record.md | 30 +- ide/src/doc/md/quickstart_filesystem.md | 19 +- ide/src/doc/md/quickstart_hiperf.md | 15 +- ide/src/doc/md/quickstart_hisystemevent.md | 2 +- ide/src/doc/md/quickstart_native_memory.md | 7 +- ide/src/doc/md/quickstart_page_fault.md | 10 +- ide/src/doc/md/quickstart_parsing_ability.md | 2 +- ide/src/doc/md/quickstart_sql_metrics.md | 2 +- ide/src/doc/md/quickstart_systemtrace.md | 4 +- ide/src/doc/md/quickstart_web_record.md | 19 +- ide/src/doc/quickstart_bio.html | 10 +- ide/src/doc/quickstart_device_record.html | 4 +- ide/src/doc/quickstart_filesystem.html | 20 +- ide/src/doc/quickstart_hiperf.html | 26 +- ide/src/doc/quickstart_page_fault.html | 4 +- .../figures/FileSystem/FileSystemOptions.jpg | Bin 84978 -> 53887 bytes .../FileSystem/FileSystemstatistics.jpg | Bin 88322 -> 45234 bytes ide/src/figures/hdc/hdc.jpg | Bin 10062 -> 7498 bytes ide/src/figures/perf/Options.jpg | Bin 136252 -> 103706 bytes ide/src/figures/perf/PerfProfile.jpg | Bin 93358 -> 93827 bytes ide/src/figures/perf/Samplelist.jpg | Bin 174714 -> 116624 bytes ide/src/figures/perf/datamining.jpg | Bin 67546 -> 104872 bytes ide/src/figures/perf/flame.jpg | Bin 113829 -> 102824 bytes ide/src/figures/perf/flameshow.jpg | Bin 119305 -> 124470 bytes ide/src/figures/perf/heaviesttrace1.jpg | Bin 104381 -> 102823 bytes ide/src/figures/perf/inputfilter.jpg | Bin 112016 -> 99802 bytes ide/src/figures/perf/samplecounter.jpg | Bin 99825 -> 102220 bytes ide/src/figures/perf/summary.jpg | Bin 56772 -> 110187 bytes .../statistics/util/SpStatisticsHttpUtil.ts | 15 +- ide/src/trace/SpApplication.ts | 99 +- ide/src/trace/SpApplicationPublicFunc.ts | 12 +- ide/src/trace/bean/BinderProcessThread.ts | 103 ++ ide/src/trace/bean/BoxSelection.ts | 92 +- ide/src/trace/bean/FuncStruct.ts | 1 + ide/src/trace/bean/GpufreqBean.ts | 129 ++ ide/src/trace/bean/ProcessStruct.ts | 2 +- ide/src/trace/bean/SchedSwitchStruct.ts | 88 +- ide/src/trace/bean/SearchFuncBean.ts | 1 + ide/src/trace/bean/StateModle.ts | 35 + ide/src/trace/component/SpHelp.ts | 2 - ide/src/trace/component/SpKeyboard.html.ts | 13 +- ide/src/trace/component/SpKeyboard.ts | 5 - .../trace/component/SpRecordConfigModel.ts | 3 + ide/src/trace/component/SpRecordTrace.ts | 58 +- .../trace/component/SpSystemTrace.event.ts | 122 +- ide/src/trace/component/SpSystemTrace.init.ts | 67 +- ide/src/trace/component/SpSystemTrace.line.ts | 104 +- ide/src/trace/component/SpSystemTrace.ts | 133 +- ide/src/trace/component/SpThirdParty.ts | 99 ++ ide/src/trace/component/Utils.ts | 10 + ide/src/trace/component/chart/FrameChart.ts | 15 + .../trace/component/chart/SpAllAppStartups.ts | 1 + .../trace/component/chart/SpChartManager.ts | 50 +- .../trace/component/chart/SpFrameTimeChart.ts | 27 +- ide/src/trace/component/chart/SpHiPerf.ts | 22 +- ide/src/trace/component/chart/SpLTPO.ts | 359 +++++ .../trace/component/chart/SpProcessChart.ts | 631 ++++---- .../trace/component/chart/SpSampleChart.ts | 313 ++++ .../component/chart/SpSegmentationChart.ts | 577 ++++++++ .../schedulingAnalysis/TabCpuAnalysis.html.ts | 2 +- .../schedulingAnalysis/TabCpuAnalysis.ts | 2 +- .../trace/component/setting/SpRecordPerf.ts | 26 +- ide/src/trace/component/trace/SpChartList.ts | 20 +- .../component/trace/TimerShaftElement.ts | 18 +- .../trace/component/trace/base/Extension.ts | 2 + .../trace/component/trace/base/RangeSelect.ts | 116 +- .../component/trace/base/TraceRow.html.ts | 18 +- .../trace/component/trace/base/TraceRow.ts | 126 +- .../component/trace/base/TraceRowConfig.ts | 20 +- .../trace/component/trace/base/TraceSheet.ts | 98 +- .../component/trace/base/TraceSheetConfig.ts | 68 +- ide/src/trace/component/trace/base/Utils.ts | 6 +- .../component/trace/sheet/TabPaneCurrent.ts | 30 +- .../trace/sheet/TabPaneCurrentSelection.ts | 130 +- .../trace/sheet/TabPaneFilter.html.ts | 7 +- .../component/trace/sheet/TabPaneFilter.ts | 6 +- .../sheet/ability/TabPaneMemoryAbility.ts | 2 +- .../sheet/ability/TabPaneNetworkAbility.ts | 2 +- .../trace/sheet/ability/TabPanePurgPin.ts | 2 +- .../TabPanePurgPinComparisonAbility.ts | 2 +- .../trace/sheet/ability/TabPanePurgTotal.ts | 2 +- .../TabPanePurgTotalComparisonAbility.ts | 2 +- .../trace/sheet/ark-ts/TabPaneJsCpu.ts | 30 +- .../trace/sheet/ark-ts/TabPaneSummary.ts | 13 +- .../sheet/binder/TabPaneBinderDataCut.ts | 756 ++++++++++ .../trace/sheet/binder/TabPaneBinders.ts | 182 +++ .../trace/sheet/clock/TabPaneClockCounter.ts | 2 + .../trace/sheet/cpu/TabPaneBoxChild.ts | 2 +- .../trace/sheet/cpu/TabPaneCpuByThread.ts | 6 +- .../trace/sheet/cpu/TabPaneCpuUsage.ts | 6 +- .../trace/sheet/cpu/TabPaneFrequencySample.ts | 2 +- .../component/trace/sheet/cpu/TabPanePTS.ts | 7 +- .../component/trace/sheet/cpu/TabPaneSPT.ts | 7 +- .../trace/sheet/cpu/TabPaneSchedPriority.ts | 10 +- .../sheet/file-system/TabPaneCallTree.ts | 15 +- .../file-system/TabPaneFileSystemCalltree.ts | 42 +- .../TabPaneFilesystemStatistics.ts | 45 +- .../TabPaneFilesystemStatisticsAnalysis.ts | 43 +- .../file-system/TabPaneIOTierStatistics.ts | 66 +- .../TabPaneIOTierStatisticsAnalysis.ts | 58 +- .../TabPaneVirtualMemoryStatistics.ts | 61 +- ...aneVirtualMemoryStatisticsAnalysis.html.ts | 4 + .../TabPaneVirtualMemoryStatisticsAnalysis.ts | 30 +- .../sheet/frequsage/TabPaneFreqDataCut.ts | 1266 +++++++++++++++++ .../trace/sheet/frequsage/TabPaneFreqUsage.ts | 696 +++++---- .../sheet/frequsage/TabPaneFreqUsageConfig.ts | 32 + .../trace/sheet/gpu/TabPaneGpuClickSelect.ts | 38 +- .../gpu/TabPaneGpuClickSelectComparison.ts | 2 +- .../component/trace/sheet/gpu/TabPaneGpuGL.ts | 24 +- .../sheet/gpu/TabPaneGpuWindowBoxSelect.ts | 4 +- .../sheet/gpufreq/TabPaneGpufreqDataCut.ts | 470 ++++++ .../sheet/gpufreq/TabPaneGpufreqUsage.ts | 229 +++ .../trace/sheet/hilog/TabPaneHiLogs.ts | 34 +- .../trace/sheet/hiperf/TabPanePerfAnalysis.ts | 14 +- .../trace/sheet/hiperf/TabPerfBottomUp.ts | 2 +- .../trace/sheet/hiperf/TabPerfProfile.ts | 12 +- .../sheet/hisysevent/TabPaneHisysEvents.ts | 27 +- .../sheet/native-memory/TabPaneNMCallTree.ts | 24 +- .../TabPaneNMStatisticAnalysis.ts | 17 +- .../trace/sheet/process/TabPaneSlices.ts | 58 +- .../trace/sheet/process/TabPaneStartup.ts | 12 +- .../trace/sheet/process/TabPaneStaticInit.ts | 16 +- .../sheet/process/TabPaneThreadStates.ts | 2 +- .../trace/sheet/process/TabPaneThreadUsage.ts | 29 +- .../sheet/sample/TabPaneSampleInstruction.ts | 434 ++++++ .../TabPaneSampleInstructionDistributions.ts | 400 ++++++ .../TabPaneSampleInstructionSelection.ts | 436 ++++++ ...PaneSampleInstructionSelectionTotalTime.ts | 381 +++++ .../sheet/schedswitch/TabPaneSchedSwitch.ts | 752 ++++++++++ .../sheet/states/TabPaneFreqStatesDataCut.ts | 740 ++++++++++ .../component/trace/timer-shaft/RangeRuler.ts | 10 +- .../component/trace/timer-shaft/SportRuler.ts | 16 +- .../trace/timer-shaft/TabPaneFlag.ts | 17 - ide/src/trace/database/StateBusyTimeWorker.ts | 4 +- .../data-trafic/AbilityMonitorReceiver.ts | 110 +- .../database/data-trafic/ClockDataReceiver.ts | 2 +- .../database/data-trafic/ClockDataSender.ts | 9 +- .../database/data-trafic/CpuDataReceiver.ts | 5 +- .../database/data-trafic/CpuDataSender.ts | 4 +- .../data-trafic/EnergySysEventReceiver.ts | 292 ++-- .../data-trafic/FrameDynamicEffectReceiver.ts | 56 +- .../data-trafic/FrameDynamicEffectSender.ts | 6 +- .../data-trafic/FrameJanksReceiver.ts | 81 +- .../database/data-trafic/FrameJanksSender.ts | 3 - .../data-trafic/HiSysEventDataReceiver.ts | 94 +- .../database/data-trafic/LogDataReceiver.ts | 116 +- .../database/data-trafic/LostFrameReceiver.ts | 59 + .../database/data-trafic/LostFrameSender.ts | 61 + .../data-trafic/cpu/CpuStateReceiver.ts | 2 +- .../hiperf/HiperfProcessDataSender.ts | 4 +- .../hiperf/HiperfThreadDataSender.ts | 3 +- .../data-trafic/process/FuncDataReceiver.ts | 11 +- .../data-trafic/process/FuncDataSender.ts | 7 +- .../data-trafic/utils/AllMemoryCache.ts | 20 + .../database/data-trafic/utils/DataFilter.ts | 2 +- .../data-trafic/utils/ExecProtoForWorker.ts | 3 + .../database/data-trafic/utils/QueryEnum.ts | 2 + .../ProcedureLogicWorkerCommon.ts | 6 +- .../ProcedureLogicWorkerFileSystem.ts | 46 +- .../logic-worker/ProcedureLogicWorkerPerf.ts | 4 +- .../ProcedureLogicWorkerSchedulingAnalysis.ts | 2 +- ide/src/trace/database/sql/Clock.sql.ts | 11 +- ide/src/trace/database/sql/Cpu.sql.ts | 11 +- ide/src/trace/database/sql/Func.sql.ts | 282 +++- ide/src/trace/database/sql/Ltpo.sql.ts | 43 + ide/src/trace/database/sql/Memory.sql.ts | 6 +- ide/src/trace/database/sql/Perf.sql.ts | 109 ++ .../trace/database/sql/ProcessThread.sql.ts | 221 ++- ide/src/trace/database/sql/SqlLite.sql.ts | 13 +- .../database/ui-worker/ProcedureWorker.ts | 16 +- .../ui-worker/ProcedureWorkerAppStartup.ts | 2 +- .../ui-worker/ProcedureWorkerClock.ts | 2 +- .../ui-worker/ProcedureWorkerCommon.ts | 191 ++- .../ui-worker/ProcedureWorkerCpuProfiler.ts | 11 +- .../database/ui-worker/ProcedureWorkerEBPF.ts | 20 +- .../ProcedureWorkerFrameAnimation.ts | 14 +- .../ui-worker/ProcedureWorkerFrameDynamic.ts | 12 +- .../ui-worker/ProcedureWorkerFrameSpacing.ts | 14 +- .../database/ui-worker/ProcedureWorkerFreq.ts | 2 +- .../ui-worker/ProcedureWorkerFreqExtend.ts | 49 +- .../database/ui-worker/ProcedureWorkerFunc.ts | 33 +- .../database/ui-worker/ProcedureWorkerHeap.ts | 2 +- .../ui-worker/ProcedureWorkerHeapSnapshot.ts | 30 +- .../ui-worker/ProcedureWorkerHitchTime.ts | 119 ++ .../database/ui-worker/ProcedureWorkerIrq.ts | 2 +- .../database/ui-worker/ProcedureWorkerJank.ts | 5 +- .../database/ui-worker/ProcedureWorkerLTPO.ts | 115 ++ .../ui-worker/ProcedureWorkerSample.ts | 214 +++ .../ui-worker/ProcedureWorkerSnapshot.ts | 139 +- .../ui-worker/ProcedureWorkerSoInit.ts | 2 +- .../ui-worker/ProcedureWorkerThread.ts | 33 +- .../ui-worker/cpu/ProcedureWorkerCPU.ts | 2 +- .../cpu/ProcedureWorkerCpuFreqLimits.ts | 2 +- .../ui-worker/cpu/ProcedureWorkerCpuState.ts | 2 +- .../ui-worker/procedureWorkerBinder.ts | 122 ++ ide/test/base-ui/modal/LitModal.test.ts | 186 --- ide/test/base-ui/select/LitSelect.test.ts | 4 +- ide/test/base-ui/table/LitTable.test.ts | 98 +- ide/test/trace/SpApplication.test.ts | 47 +- ide/test/trace/bean/BoxSelection.test.ts | 106 +- ide/test/trace/bean/FpsStruct.test.ts | 6 +- ide/test/trace/bean/ProcessStruct.test.ts | 14 +- .../trace/component/SpInfoAndStas.test.ts | 4 +- ide/test/trace/component/SpQuerySQL.test.ts | 4 +- .../trace/component/SpRecordTrace.test.ts | 293 +--- .../trace/component/SpSystemTrace.test.ts | 25 +- .../component/chart/PerfDataQuery.test.ts | 3 + .../component/chart/SpAbilityMonitor.test.ts | 37 +- .../component/chart/SpAllAppStartups.test.ts | 70 + .../component/chart/SpArkTsChart.test.ts | 33 +- .../component/chart/SpChartManager.test.ts | 8 +- .../component/chart/SpClockChart.test.ts | 6 +- .../trace/component/chart/SpCpuChart.test.ts | 10 +- .../trace/component/chart/SpEBPFChart.test.ts | 20 +- .../trace/component/chart/SpFpsChart.test.ts | 9 +- .../component/chart/SpFrameTimeChart.test.ts | 43 +- .../trace/component/chart/SpFreqChart.test.ts | 11 +- .../trace/component/chart/SpHiPerf.test.ts | 25 +- .../chart/SpHiSysEnergyChart.test.ts | 33 +- .../component/chart/SpHiSysEventChart.test.ts | 27 +- .../trace/component/chart/SpIrqChart.test.ts | 8 +- .../component/chart/SpJsMemoryChart.test.ts | 7 +- .../trace/component/chart/SpLogChart.test.ts | 5 +- .../trace/component/chart/SpLtpoChart.test.ts | 112 ++ .../chart/SpNativeMemoryChart.test.ts | 22 +- .../component/chart/SpProcessChart.test.ts | 88 +- .../trace/component/chart/SpSdkChart.test.ts | 103 +- .../component/chart/SpVirtualMemChart.test.ts | 28 +- .../component/chart/SpVmTrackerChart.test.ts | 44 +- .../component/setting/SpAllocations.test.ts | 70 +- .../component/setting/SpRecordPerf.test.ts | 2 +- .../component/setting/SpWebHdcShell.test.ts | 8 +- .../setting/utils/PluginConvertUtils.test.ts | 14 - .../component/trace/TimerShaftElement.test.ts | 6 +- .../component/trace/base/RangeSelect.test.ts | 81 +- .../component/trace/base/TraceRow.test.ts | 124 +- .../trace/base/TraceRowConfig.test.ts | 3 +- .../trace/base/TraceRowRecyclerView.test.ts | 16 +- .../component/trace/base/TraceSheet.test.ts | 58 +- .../trace/component/trace/base/Utils.test.ts | 8 +- .../sheet/TabPaneCurrentSelection.test.ts | 12 +- .../sheet/ability/TabPaneCpuAbility.test.ts | 6 +- .../sheet/ability/TabPaneDiskAbility.test.ts | 6 +- .../sheet/ability/TabPaneDmaAbility.test.ts | 6 +- .../TabPaneDmaAbilityComparison.test.ts | 6 +- .../ability/TabPaneDmaSelectAbility.test.ts | 9 +- .../ability/TabPaneGpuMemoryAbility.test.ts | 6 +- .../TabPaneGpuMemoryComparison.test.ts | 6 +- .../TabPaneGpuMemorySelectAbility.test.ts | 6 +- .../ability/TabPaneHistoryProcesses.test.ts | 4 +- .../ability/TabPaneLiveProcesses.test.ts | 4 +- .../ability/TabPaneMemoryAbility.test.ts | 9 +- .../ability/TabPaneNetworkAbility.test.ts | 4 +- .../sheet/ability/TabPanePurgPin.test.ts | 4 +- .../TabPanePurgPinComparisonAbility.test.ts | 4 +- .../ability/TabPanePurgPinSelection.test.ts | 9 +- .../sheet/ability/TabPanePurgTotal.test.ts | 4 +- .../TabPanePurgTotalComparisonAbility.test.ts | 4 +- .../ability/TabPanePurgTotalSelection.test.ts | 8 +- .../ark-ts/TabPaneJsCpuStatistics.test.ts | 19 +- .../trace/sheet/binder/TabPaneBinder.test.ts | 77 - .../sheet/binder/TabPaneBinderDataCut.test.ts | 178 --- .../sheet/clock/TabPaneClockCounter.test.ts | 7 +- .../trace/sheet/cpu/TabPaneBoxChild.test.ts | 8 +- .../sheet/cpu/TabPaneCounterSample.test.ts | 14 +- .../sheet/cpu/TabPaneCpuByProcess.test.ts | 14 +- .../sheet/cpu/TabPaneCpuByThread.test.ts | 4 +- .../trace/sheet/cpu/TabPaneCpuUsage.test.ts | 4 +- .../sheet/cpu/TabPaneFrequencySample.test.ts | 17 +- .../trace/sheet/cpu/TabPanePTS.test.ts | 1 - .../trace/sheet/cpu/TabPaneSPT.test.ts | 2 - .../sheet/energy/TabPaneEnergyAnomaly.test.ts | 9 +- .../sheet/energy/TabPanePowerBattery.test.ts | 8 +- .../sheet/energy/TabPanePowerDetails.test.ts | 9 +- .../sheet/energy/TabPaneSystemDetails.test.ts | 10 +- .../TabPaneFileSystemCalltree.test.ts | 4 +- .../TabPaneFilesystemStatistics.test.ts | 4 +- ...abPaneFilesystemStatisticsAnalysis.test.ts | 2 +- .../TabPaneIOTierStatistics.test.ts | 11 +- .../TabPaneIoCompletionTimes.test.ts | 4 +- .../sheet/file-system/TabPaneVMEvents.test.ts | 4 +- .../TabPaneVirtualMemoryStatistics.test.ts | 5 +- .../trace/sheet/fps/TabPaneFps.test.ts | 4 +- .../frequsage/TabPaneFreqDataCut.test.ts | 138 -- .../sheet/frequsage/TabPaneFreqUsage.test.ts | 13 +- .../sheet/gpu/TabPaneGpuClickSelect.test.ts | 4 +- .../TabPaneGpuClickSelectComparison.test.ts | 4 +- .../trace/sheet/gpu/TabPaneGpuGL.test.ts | 4 +- .../gpu/TabPaneGpuTotalBoxSelect.test.ts | 7 +- .../gpu/TabPaneGpuWindowBoxSelect.test.ts | 8 +- .../gpufreq/tabPaneGpufreqDataCut.test.ts | 150 -- .../sheet/gpufreq/tabPaneGpufreqUsage.test.ts | 98 -- .../hi-sysevent/TabPaneHisysEvents.test.ts | 61 +- .../trace/sheet/hilog/TabPaneHilogs.test.ts | 14 +- .../sheet/hiperf/TabPanePerfAnalysis.test.ts | 33 +- .../sheet/hiperf/TabPerfBottomUp.test.ts | 1 - .../sheet/hiperf/TabPerfSampleList.test.ts | 17 +- .../trace/sheet/irq/TabPaneIrqCounter.test.ts | 22 +- .../trace/sheet/jank/TabPaneFrames.test.ts | 18 + .../native-memory/TabPaneNMCallTree.test.ts | 27 +- .../native-memory/TabPaneNMSampleList.test.ts | 17 +- .../TabPaneNMStatisticAnalysis.test.ts | 1 - .../native-memory/TabPaneNMStatstics.test.ts | 428 +----- .../native-memory/TabPaneNMemory.test.ts | 20 +- .../sheet/process/TabPaneCounter.test.ts | 19 +- .../trace/sheet/process/TabPaneSlices.test.ts | 19 +- .../sheet/process/TabPaneStartup.test.ts | 4 +- .../sheet/process/TabPaneStaticInit.test.ts | 4 +- .../sheet/process/TabPaneThreadStates.test.ts | 5 +- .../sheet/process/TabPaneThreadUsage.test.ts | 7 +- .../schedswitch/TabPaneSchedSwitch.test.ts | 204 --- .../trace/sheet/sdk/TabPaneSdkCounter.test.ts | 11 +- .../trace/sheet/sdk/TabPaneSdkSlice.test.ts | 9 +- .../smaps/TabPaneSmapsComparison.test.ts | 9 +- .../sheet/smaps/TabPaneSmapsRecord.test.ts | 8 +- .../smaps/TabPaneSmapsStatistics.test.ts | 8 +- .../sheet/task/TabPaneTaskFrames.test.ts | 19 +- .../TabPaneDmaSelectVmTracker.test.ts | 8 +- .../vmtracker/TabPaneDmaVmTracker.test.ts | 4 +- .../TabPaneDmaVmTrackerComparison.test.ts | 4 +- .../TabPaneGpuMemorySelectVmTracker.test.ts | 4 +- .../TabPaneGpuMemoryVmTracker.test.ts | 7 +- ...abPaneGpuMemoryVmTrackerComparison.test.ts | 9 +- .../TabPanePurgPinComparisonVM.test.ts | 4 +- .../TabPanePurgTotalComparisonVM.test.ts | 7 +- .../vmtracker/TabPaneVmTrackerShm.test.ts | 4 +- .../TabPaneVmTrackerShmComparison.test.ts | 4 +- .../TabPaneVmTrackerShmSelection.test.ts | 7 +- .../trace/timer-shaft/RangeRuler.test.ts | 54 +- .../trace/timer-shaft/SportRuler.test.ts | 2 - .../trace/timer-shaft/TabPaneFlag.test.ts | 4 +- .../trace/timer-shaft/TimeRuler.test.ts | 5 +- .../AbilityMonitorReceiver.test.ts | 105 ++ .../data-trafic/AbilityMonitorSender.test.ts | 196 +++ .../data-trafic/ArkTsReceiver.test.ts | 52 + .../database/data-trafic/ArkTsSender.test.ts | 46 + .../data-trafic/ClockDataReceiver.test.ts | 86 ++ .../data-trafic/ClockDataSender.test.ts | 51 + .../data-trafic/CpuDataReceiver.test.ts | 97 ++ .../data-trafic/CpuDataSender.test.ts | 59 + .../database/data-trafic/EBPFReceiver.test.ts | 81 ++ .../database/data-trafic/EBPFSender.test.ts | 80 ++ .../EnergySysEventReceiver.test.ts | 226 +++ .../data-trafic/EnergySysEventSender.test.ts | 114 ++ .../FrameDynamicEffectReceiver.test.ts | 104 ++ .../FrameDynamicEffectSender.test.ts | 112 ++ .../data-trafic/FrameJanksReceiver.test.ts | 94 ++ .../data-trafic/FrameJanksSender.test.ts | 93 ++ .../data-trafic/HiSysEventDataReciver.test.ts | 55 + .../data-trafic/HiSysEventDataSender.test.ts | 59 + .../data-trafic/IrqDataReceiver.test.ts | 104 ++ .../data-trafic/IrqDataSender.test.ts | 46 + .../data-trafic/LogDataReceiver.test.ts | 55 + .../data-trafic/LogDataSender.test.ts | 57 + .../NativeMemoryDataReceiver.test.ts | 74 + .../NativeMemoryDataSender.test.ts | 71 + .../VirtualMemoryDataReceiver.test.ts | 58 + .../VirtualMemoryDataSender.test.ts | 47 + .../data-trafic/VmTrackerDataReceiver.test.ts | 136 ++ .../data-trafic/VmTrackerDataSender.test.ts | 181 +++ .../cpu/CpuFreqDataReceiver.test.ts | 62 + .../data-trafic/cpu/CpuFreqDataSender.test.ts | 50 + .../cpu/CpuFreqLimitDataReceiver.test.ts | 62 + .../cpu/CpuFreqLimitDataSender.test.ts | 53 + .../data-trafic/cpu/CpuStateReceiver.test.ts | 67 + .../data-trafic/cpu/CpuStateSender.test.ts | 51 + .../hiperf/HiperfCallChartReceiver.test.ts | 75 + .../hiperf/HiperfCpuDataReceiver.test.ts | 64 + .../hiperf/HiperfCpuDataSender.test.ts | 58 + .../hiperf/HiperfProcessDataReceiver.test.ts | 85 ++ .../hiperf/HiperfProcessDataSender.test.ts | 48 + .../hiperf/HiperfThreadDataReceiver.test.ts | 85 ++ .../hiperf/HiperfThreadDataSender.test.ts | 47 + .../process/FuncDataReceiver.test.ts | 82 ++ .../process/FuncDataSender.test.ts | 55 + .../process/ProcessActualDataReceiver.test.ts | 59 + .../process/ProcessActualDataSender.test.ts | 56 + .../process/ProcessDataReceiver.test.ts | 59 + .../process/ProcessDataSender.test.ts | 43 + ...ocessDeliverInputEventDataReceiver.test.ts | 63 + ...ProcessDeliverInputEventDataSender.test.ts | 55 + .../ProcessExpectedDataReceiver.test.ts | 58 + .../process/ProcessExpectedDataSender.test.ts | 51 + .../process/ProcessMemDataReceiver.test.ts | 54 + .../process/ProcessMemDataSender.test.ts | 47 + .../ProcessSoInitDataReceiver.test.ts} | 45 +- .../process/ProcessSoInitDataSender.test.ts | 37 + .../ProcessStartupDataReceiver.test.ts | 58 + .../process/ProcessStartupDataSender.test.ts | 48 + .../process/ThreadDataReceiver.test.ts | 71 + .../process/ThreadDataSender.test.ts | 49 + .../data-trafic/utils/DataFilter.test.ts | 90 ++ .../ProcedureLogicWorkerCommon.test.ts | 8 +- .../ProcedureLogicWorkerFileSystem.test.ts | 12 +- .../ProcedureLogicWorkerJsCpuProfiler.test.ts | 4 +- .../ProcedureLogicWorkerNativeNemory.test.ts | 2 +- .../ProcedureLogicWorkerPerf.test.ts | 4 +- .../ProcedureWorkerAllAppStartup.test.ts | 101 ++ .../ProcedureWorkerAppStartup.test.ts | 16 +- .../ui-worker/ProcedureWorkerCPU.test.ts | 71 +- .../ui-worker/ProcedureWorkerClock.test.ts | 16 +- .../ui-worker/ProcedureWorkerCommon.test.ts | 147 +- .../ProcedureWorkerCpuAbility.test.ts | 12 +- .../ProcedureWorkerCpuFreqLimits.test.ts | 9 +- .../ProcedureWorkerCpuProfiler.test.ts | 16 +- .../ui-worker/ProcedureWorkerCpuState.test.ts | 6 +- .../ProcedureWorkerDiskIoAbility.test.ts | 7 +- .../ProcedureWorkerEnergyPower.test.ts | 69 +- .../ProcedureWorkerEnergyState.test.ts | 51 +- .../ProcedureWorkerEnergySystem.test.ts | 60 - .../ui-worker/ProcedureWorkerFPS.test.ts | 59 +- .../ProcedureWorkerFrameAnimation.test.ts | 3 + .../ProcedureWorkerFrameDynamic.test.ts | 4 +- .../ProcedureWorkerFrameSpacing.test.ts | 12 +- .../ui-worker/ProcedureWorkerFreq.test.ts | 4 +- .../ProcedureWorkerFreqExtend.test.ts | 100 ++ .../ui-worker/ProcedureWorkerFunc.test.ts | 4 +- .../ui-worker/ProcedureWorkerHeap.test.ts | 4 +- .../ProcedureWorkerHeapSnapshot.test.ts | 20 +- .../ProcedureWorkerHiPerfCPU.test.ts | 70 +- .../ProcedureWorkerHiPerfCallChart.test.ts | 133 ++ .../ProcedureWorkerHiPerfEvent.test.ts | 10 +- .../ProcedureWorkerHiPerfProcess.test.ts | 12 +- .../ProcedureWorkerHiPerfReport.test.ts | 10 +- .../ProcedureWorkerHiPerfThread.test.ts | 12 +- .../ProcedureWorkerHiSysEvent.test.ts | 77 + .../ProcedureWorkerHitchTime.test.ts | 89 ++ .../ui-worker/ProcedureWorkerIrq.test.ts | 57 +- .../ui-worker/ProcedureWorkerJank.test.ts | 6 +- .../ui-worker/ProcedureWorkerLTPO.test.ts | 89 ++ .../ui-worker/ProcedureWorkerLog.test.ts | 163 ++- .../ui-worker/ProcedureWorkerMem.test.ts | 33 +- .../ProcedureWorkerMemoryAbility.test.ts | 6 +- .../ProcedureWorkerNetworkAbility.test.ts | 4 +- .../ProcedureWorkerPerfCallchains.test.ts | 1 - .../ui-worker/ProcedureWorkerProcess.test.ts | 54 +- .../ui-worker/ProcedureWorkerSnapshot.test.ts | 4 +- .../ui-worker/ProcedureWorkerSoInit.test.ts | 257 ++-- .../ui-worker/ProcedureWorkerThread.test.ts | 5 +- .../ui-worker/ProcedureWorkerTimeline.test.ts | 11 +- .../ProcedureWorkerVirtualMemory.test.ts | 12 +- .../ui-worker/ProduceWorkerSdkCounter.test.ts | 6 +- .../ui-worker/ProduceWorkerSdkSlice.test.ts | 6 +- ide/tsconfig_test.json | 19 + ide/webpack.config.js | 57 +- trace_streamer/.gn | 2 +- trace_streamer/.gn_unix | 2 +- trace_streamer/.gn_win | 2 +- trace_streamer/BUILD.gn | 2 +- trace_streamer/build.sh | 40 +- trace_streamer/build/config.gni | 2 +- trace_streamer/build/ohos.gni | 2 +- trace_streamer/build/protoc.sh | 2 +- trace_streamer/build/test.gni | 2 +- trace_streamer/build/ts.gni | 11 +- trace_streamer/build_operator.sh | 23 +- trace_streamer/dl_emsdk.sh | 18 +- trace_streamer/dl_tools.sh | 2 +- trace_streamer/doc/des_tables.md | 4 - trace_streamer/format-code.sh | 2 +- trace_streamer/gcov.sh | 2 +- trace_streamer/gn/BUILD.gn | 4 +- trace_streamer/gn/CONFIG.gn | 3 +- trace_streamer/gn/toolchain/BUILD.gn | 16 +- trace_streamer/gn/wasm.gni | 16 +- trace_streamer/gn/wasm_vars.gni | 2 +- trace_streamer/huoyantu.sh | 2 +- trace_streamer/lcov.sh | 2 +- trace_streamer/lcov_operator.sh | 2 +- .../{gn/.emscripten => mac_depend.sh} | 32 +- trace_streamer/pare_third_party.sh | 15 +- .../bounds_checking_functionbuild.gn | 2 +- .../patch_googletest/googletestbuild.gn | 4 +- .../patch_googletest/gtest-message.h.patch | 15 - .../prebuilts/patch_googletest/gtest.patch | 79 + .../patch_googletest/gtest_internal.h.patch | 14 - .../patch_googletest/gtest_port.h.patch | 23 - .../prebuilts/patch_hiperf/BUILD.gn | 4 +- .../prebuilts/patch_hiperf/file_ex.h | 4 +- .../prebuilts/patch_hiperf/hiviewdfx_BUILD.gn | 4 - .../prebuilts/patch_hiperf/unique_fd.h | 4 +- .../patch_libunwind/libunwindbuild.gn | 2 +- .../prebuilts/patch_protobuf/protobufbuild.gn | 2 +- .../prebuilts/patch_sqlite/sqlite3build.gn | 2 +- .../prebuilts/patch_zlib/zlibbuild.gn | 66 + trace_streamer/sdk/demo_sdk/BUILD.gn | 2 +- trace_streamer/sdk/demo_sdk/doc/wasm.md | 30 - trace_streamer/sdk/demo_sdk/main.cpp | 4 +- trace_streamer/sdk/demo_sdk/plugin/BUILD.gn | 2 +- .../plugin/sdk_plugin_data_parser.cpp | 4 +- .../demo_sdk/plugin/sdk_plugin_data_parser.h | 4 +- trace_streamer/sdk/demo_sdk/protos/BUILD.gn | 2 +- .../sdk/demo_sdk/protos/protogen.sh | 2 +- trace_streamer/sdk/demo_sdk/protos/protos.gni | 2 +- .../protos/types/plugins/mock_data/BUILD.gn | 29 +- .../mock_data/mock_plugin_config.proto | 2 +- .../mock_data/mock_plugin_result.proto | 2 +- .../sdk/demo_sdk/rpc/demo_rpc_server.cpp | 5 +- .../sdk/demo_sdk/rpc/demo_rpc_server.h | 4 +- .../sdk/demo_sdk/sdk/sdk_data_parser.cpp | 4 +- .../sdk/demo_sdk/sdk/sdk_data_parser.h | 4 +- trace_streamer/sdk/demo_sdk/sdk/ts.gni | 2 +- .../sdk/demo_sdk/sdk/ts_sdk_api.cpp | 4 +- trace_streamer/sdk/demo_sdk/sdk/ts_sdk_api.h | 4 +- trace_streamer/sdk/demo_sdk/sdk/wasm_func.cpp | 4 +- trace_streamer/sdk/demo_sdk/sdk/wasm_func.h | 4 +- .../sdk/demo_sdk/table/demo_meta_table.cpp | 4 +- .../sdk/demo_sdk/table/demo_meta_table.h | 4 +- .../sdk/demo_sdk/table/demo_table_base.cpp | 4 +- .../sdk/demo_sdk/table/demo_table_base.h | 4 +- .../table/gpu_counter_object_table.cpp | 4 +- .../demo_sdk/table/gpu_counter_object_table.h | 4 +- .../sdk/demo_sdk/table/gpu_counter_table.cpp | 4 +- .../sdk/demo_sdk/table/gpu_counter_table.h | 4 +- .../sdk/demo_sdk/table/slice_object_table.cpp | 4 +- .../sdk/demo_sdk/table/slice_object_table.h | 4 +- .../sdk/demo_sdk/table/slice_table.cpp | 4 +- .../sdk/demo_sdk/table/slice_table.h | 4 +- trace_streamer/sdk/demo_sdk/test/BUILD.gn | 3 +- .../demo_sdk/test/unittest/sdk_api_test.cpp | 4 +- .../demo_trace_data_cache_reader.cpp | 4 +- .../trace_data/demo_trace_data_cache_reader.h | 4 +- .../demo_trace_data_cache_writer.cpp | 4 +- .../trace_data/demo_trace_data_cache_writer.h | 4 +- .../trace_data/demo_trace_data_db.cpp | 4 +- .../demo_sdk/trace_data/demo_trace_data_db.h | 4 +- .../demo_sdk/trace_data/trace_data_cache.cpp | 4 +- .../demo_sdk/trace_data/trace_data_cache.h | 4 +- .../trace_data/trace_data_cache_base.cpp | 4 +- .../trace_data/trace_data_cache_base.h | 4 +- .../sdk/demo_sdk/trace_data/trace_stdtype.cpp | 4 +- .../sdk/demo_sdk/trace_data/trace_stdtype.h | 4 +- .../trace_streamer_selector.cpp | 4 +- .../trace_streamer/trace_streamer_selector.h | 4 +- trace_streamer/sdk/demo_sdk/ts.gni | 2 +- trace_streamer/sdk/demo_sdk/version.cpp | 4 +- trace_streamer/sdk/demo_sdk/version.h | 4 +- trace_streamer/sdktest.sh | 2 +- trace_streamer/src/BUILD.gn | 9 +- trace_streamer/src/base/BUILD.gn | 2 +- trace_streamer/src/base/args_set.h | 4 +- trace_streamer/src/base/base_map.h | 4 +- trace_streamer/src/base/clock_filter.cpp | 4 +- trace_streamer/src/base/clock_filter.h | 4 +- trace_streamer/src/base/codec_cov.cpp | 4 +- trace_streamer/src/base/codec_cov.h | 4 +- trace_streamer/src/base/double_map.h | 4 +- trace_streamer/src/base/file.cpp | 4 +- trace_streamer/src/base/file.h | 4 +- .../src/base/filter_constraints.cpp | 4 +- trace_streamer/src/base/filter_constraints.h | 4 +- trace_streamer/src/base/htrace_file_header.h | 4 +- .../src/base/htrace_plugin_time_parser.cpp | 4 +- .../src/base/htrace_plugin_time_parser.h | 4 +- trace_streamer/src/base/index_map.cpp | 4 +- trace_streamer/src/base/index_map.h | 44 +- trace_streamer/src/base/log.cpp | 4 +- trace_streamer/src/base/log.h | 4 +- trace_streamer/src/base/numerical_to_string.h | 4 +- trace_streamer/src/base/optimize.h | 4 +- trace_streamer/src/base/parting_string.cpp | 4 +- trace_streamer/src/base/parting_string.h | 4 +- trace_streamer/src/base/quatra_map.h | 4 +- trace_streamer/src/base/sqlite_ext/BUILD.gn | 2 +- .../src/base/sqlite_ext/sqlite_ext_funcs.cpp | 4 +- .../src/base/sqlite_ext/sqlite_ext_funcs.h | 4 +- trace_streamer/src/base/string_help.cpp | 16 +- trace_streamer/src/base/string_help.h | 5 +- trace_streamer/src/base/string_to_numerical.h | 4 +- trace_streamer/src/base/triple_map.h | 4 +- trace_streamer/src/base/ts_common.cpp | 4 +- trace_streamer/src/base/ts_common.h | 4 +- .../src/cfg/trace_streamer_config.cpp | 4 +- .../src/cfg/trace_streamer_config.h | 4 +- trace_streamer/src/filter/BUILD.gn | 2 +- .../src/filter/animation_filter.cpp | 4 +- trace_streamer/src/filter/animation_filter.h | 4 +- .../src/filter/app_start_filter.cpp | 4 +- trace_streamer/src/filter/app_start_filter.h | 4 +- trace_streamer/src/filter/args_filter.cpp | 4 +- trace_streamer/src/filter/args_filter.h | 4 +- trace_streamer/src/filter/binder_filter.cpp | 4 +- trace_streamer/src/filter/binder_filter.h | 4 +- trace_streamer/src/filter/clock_filter_ex.cpp | 4 +- trace_streamer/src/filter/clock_filter_ex.h | 4 +- trace_streamer/src/filter/cpu_filter.cpp | 84 +- trace_streamer/src/filter/cpu_filter.h | 23 +- trace_streamer/src/filter/filter_base.cpp | 4 +- trace_streamer/src/filter/filter_base.h | 4 +- trace_streamer/src/filter/filter_filter.cpp | 9 +- trace_streamer/src/filter/filter_filter.h | 4 +- trace_streamer/src/filter/frame_filter.cpp | 96 +- trace_streamer/src/filter/frame_filter.h | 12 +- .../src/filter/hi_sysevent_measure_filter.cpp | 4 +- .../src/filter/hi_sysevent_measure_filter.h | 4 +- trace_streamer/src/filter/irq_filter.cpp | 4 +- trace_streamer/src/filter/irq_filter.h | 4 +- trace_streamer/src/filter/measure_filter.cpp | 4 +- trace_streamer/src/filter/measure_filter.h | 4 +- .../src/filter/native_hook_filter.cpp | 61 +- .../src/filter/native_hook_filter.h | 8 +- .../filter/offline_symbolization_filter.cpp | 6 +- .../src/filter/offline_symbolization_filter.h | 5 +- .../src/filter/perf_data_filter.cpp | 4 +- trace_streamer/src/filter/perf_data_filter.h | 4 +- trace_streamer/src/filter/process_filter.cpp | 4 +- trace_streamer/src/filter/process_filter.h | 4 +- trace_streamer/src/filter/slice_filter.cpp | 48 +- trace_streamer/src/filter/slice_filter.h | 27 +- trace_streamer/src/filter/stat_filter.cpp | 4 +- trace_streamer/src/filter/stat_filter.h | 4 +- .../filter/system_event_measure_filter.cpp | 4 +- .../src/filter/system_event_measure_filter.h | 4 +- .../src/filter/task_pool_filter.cpp | 4 +- trace_streamer/src/filter/task_pool_filter.h | 4 +- trace_streamer/src/main.cpp | 48 +- trace_streamer/src/metrics/BUILD.gn | 2 +- trace_streamer/src/metrics/memAggStrategy.h | 4 +- trace_streamer/src/metrics/memStrategy.h | 4 +- trace_streamer/src/metrics/metaDataStrategy.h | 4 +- trace_streamer/src/metrics/metrics.cpp | 28 +- trace_streamer/src/metrics/metrics.h | 4 +- trace_streamer/src/metrics/sysCallStrategy.h | 10 +- .../src/metrics/traceStateStrategy.h | 4 +- .../src/metrics/traceTaskStrategy.h | 4 +- trace_streamer/src/parser/BUILD.gn | 2 +- .../bytrace_parser/bytrace_event_parser.cpp | 9 +- .../bytrace_parser/bytrace_event_parser.h | 4 +- .../bytrace_parser/bytrace_hilog_parser.cpp | 4 +- .../bytrace_parser/bytrace_hilog_parser.h | 4 +- .../bytrace_hisysevent_parser.cpp | 4 +- .../bytrace_hisysevent_parser.h | 4 +- .../parser/bytrace_parser/bytrace_parser.cpp | 4 +- .../parser/bytrace_parser/bytrace_parser.h | 4 +- trace_streamer/src/parser/common_types.h | 6 +- .../src/parser/ebpf_parser/BUILD.gn | 2 +- .../ebpf_parser/bio_latency_data_parser.cpp | 4 +- .../ebpf_parser/bio_latency_data_parser.h | 4 +- .../src/parser/ebpf_parser/ebpf_base.cpp | 4 +- .../src/parser/ebpf_parser/ebpf_base.h | 4 +- .../parser/ebpf_parser/ebpf_data_parser.cpp | 4 +- .../src/parser/ebpf_parser/ebpf_data_parser.h | 4 +- .../parser/ebpf_parser/ebpf_data_reader.cpp | 4 +- .../src/parser/ebpf_parser/ebpf_data_reader.h | 4 +- .../parser/ebpf_parser/ebpf_data_structure.h | 4 +- .../src/parser/ebpf_parser/ebpf_splitter.cpp | 4 +- .../src/parser/ebpf_parser/ebpf_splitter.h | 4 +- .../ebpf_parser/file_system_data_parser.cpp | 4 +- .../ebpf_parser/file_system_data_parser.h | 4 +- .../ebpf_parser/paged_memory_data_parser.cpp | 4 +- .../ebpf_parser/paged_memory_data_parser.h | 4 +- .../src/parser/event_parser_base.cpp | 4 +- trace_streamer/src/parser/event_parser_base.h | 4 +- .../src/parser/hiperf_parser/BUILD.gn | 2 +- .../parser/hiperf_parser/perf_data_parser.cpp | 4 +- .../parser/hiperf_parser/perf_data_parser.h | 4 +- .../parser/htrace_pbreader_parser/BUILD.gn | 2 +- .../htrace_clock_detail_parser.cpp | 4 +- .../htrace_clock_detail_parser.h | 4 +- .../htrace_cpu_data_parser.cpp | 4 +- .../htrace_cpu_data_parser.h | 4 +- .../htrace_cpu_detail_parser.cpp | 4 +- .../htrace_cpu_detail_parser.h | 4 +- .../htrace_disk_io_parser.cpp | 4 +- .../htrace_disk_io_parser.h | 4 +- .../htrace_event_parser.cpp | 14 +- .../htrace_event_parser/htrace_event_parser.h | 6 +- .../htrace_hidump_parser.cpp | 4 +- .../htrace_hidump_parser.h | 4 +- .../htrace_hilog_parser.cpp | 4 +- .../htrace_hilog_parser.h | 4 +- .../htrace_hisysevent_parser.cpp | 4 +- .../htrace_hisysevent_parser.h | 4 +- .../htrace_js_cpu_profiler_parser.cpp | 4 +- .../htrace_js_cpu_profiler_parser.h | 4 +- .../htrace_js_memory_parser.cpp | 49 +- .../htrace_js_memory_parser.h | 4 +- .../htrace_mem_parser.cpp | 6 +- .../htrace_mem_parser.h | 4 +- .../htrace_native_hook_parser.cpp | 4 +- .../htrace_native_hook_parser.h | 4 +- .../htrace_network_parser.cpp | 4 +- .../htrace_network_parser.h | 4 +- .../htrace_pbreader_parser/htrace_parser.cpp | 5 +- .../htrace_pbreader_parser/htrace_parser.h | 9 +- .../htrace_process_parser.cpp | 4 +- .../htrace_process_parser.h | 4 +- .../htrace_symbols_detail_parser.cpp | 4 +- .../htrace_symbols_detail_parser.h | 4 +- trace_streamer/src/parser/parser_base.cpp | 4 +- trace_streamer/src/parser/parser_base.h | 4 +- .../src/parser/print_event_parser.cpp | 12 +- .../src/parser/print_event_parser.h | 4 +- .../src/parser/rawtrace_parser/BUILD.gn | 2 +- .../rawtrace_parser/cpu_detail_parser.cpp | 95 +- .../rawtrace_parser/cpu_detail_parser.h | 19 +- .../ftrace_event_processor.cpp | 4 +- .../rawtrace_parser/ftrace_event_processor.h | 4 +- .../ftrace_field_processor.cpp | 4 +- .../rawtrace_parser/ftrace_field_processor.h | 4 +- .../rawtrace_parser/ftrace_processor.cpp | 6 +- .../parser/rawtrace_parser/ftrace_processor.h | 4 +- .../kernel_symbols_processor.cpp | 4 +- .../kernel_symbols_processor.h | 4 +- .../printk_formats_processor.cpp | 4 +- .../printk_formats_processor.h | 4 +- .../rawtrace_parser/rawtrace_parser.cpp | 25 +- .../parser/rawtrace_parser/rawtrace_parser.h | 6 +- .../src/parser/thread_state_flag.cpp | 4 +- trace_streamer/src/parser/thread_state_flag.h | 4 +- trace_streamer/src/proto_reader/BUILD.gn | 2 +- .../src/proto_reader/include/data_area.h | 4 +- .../src/proto_reader/include/proto_reader.h | 4 +- .../proto_reader/include/proto_reader_help.h | 4 +- .../src/proto_reader/proto_reader.cpp | 4 +- .../src/proto_reader/protoc_plugin/BUILD.gn | 2 +- .../protoc_plugin/proto_reader_plugin.cpp | 4 +- .../protoc_plugin/proto_reader_plugin.h | 4 +- trace_streamer/src/protos/protogen.sh | 2 +- trace_streamer/src/protos/protos.gni | 2 +- trace_streamer/src/protos/services/BUILD.gn | 2 +- .../src/protos/services/common_types.proto | 2 +- .../src/protos/services/plugin_service.proto | 2 +- .../services/plugin_service_types.proto | 2 +- .../protos/services/profiler_service.proto | 2 +- .../services/profiler_service_types.proto | 2 +- .../src/protos/smartperf_host/BUILD.gn | 2 +- .../src/protos/smartperf_host/sph_data.proto | 2 +- .../protos/types/plugins/agent_data/BUILD.gn | 2 +- .../agent_data/agent_plugin_app_data.proto | 2 +- .../agent_data/agent_plugin_config.proto | 2 +- .../agent_data/agent_plugin_energy_data.proto | 2 +- .../agent_data/agent_plugin_java_heap.proto | 2 +- .../agent_plugin_network_data.proto | 2 +- .../agent_data/agent_plugin_result.proto | 2 +- .../types/plugins/bytrace_plugin/BUILD.gn | 2 +- .../bytrace_plugin_config.proto | 2 +- .../protos/types/plugins/cpu_data/BUILD.gn | 2 +- .../plugins/cpu_data/cpu_plugin_config.proto | 2 +- .../plugins/cpu_data/cpu_plugin_result.proto | 2 +- .../protos/types/plugins/diskio_data/BUILD.gn | 2 +- .../diskio_data/diskio_plugin_config.proto | 2 +- .../diskio_data/diskio_plugin_result.proto | 2 +- .../plugins/ftrace_data/autogenerated.gni | 2 +- .../types/plugins/ftrace_data/binder.proto | 2 +- .../types/plugins/ftrace_data/block.proto | 2 +- .../types/plugins/ftrace_data/cgroup.proto | 2 +- .../types/plugins/ftrace_data/clk.proto | 2 +- .../plugins/ftrace_data/compaction.proto | 2 +- .../types/plugins/ftrace_data/cpuhp.proto | 2 +- .../plugins/ftrace_data/default/BUILD.gn | 2 +- .../ftrace_data/default/autogenerated.gni | 2 +- .../plugins/ftrace_data/default/binder.proto | 2 +- .../plugins/ftrace_data/default/block.proto | 2 +- .../plugins/ftrace_data/default/cgroup.proto | 2 +- .../plugins/ftrace_data/default/clk.proto | 2 +- .../ftrace_data/default/compaction.proto | 2 +- .../plugins/ftrace_data/default/cpuhp.proto | 2 +- .../ftrace_data/default/dma_fence.proto | 2 +- .../plugins/ftrace_data/default/ext4.proto | 2 +- .../plugins/ftrace_data/default/f2fs.proto | 2 +- .../ftrace_data/default/filelock.proto | 2 +- .../plugins/ftrace_data/default/filemap.proto | 2 +- .../plugins/ftrace_data/default/ftrace.proto | 2 +- .../ftrace_data/default/ftrace_event.proto | 2 +- .../plugins/ftrace_data/default/gpio.proto | 2 +- .../plugins/ftrace_data/default/gpu_mem.proto | 2 +- .../plugins/ftrace_data/default/i2c.proto | 2 +- .../plugins/ftrace_data/default/ipi.proto | 2 +- .../plugins/ftrace_data/default/irq.proto | 2 +- .../plugins/ftrace_data/default/kmem.proto | 2 +- .../plugins/ftrace_data/default/mmc.proto | 2 +- .../plugins/ftrace_data/default/net.proto | 2 +- .../plugins/ftrace_data/default/oom.proto | 2 +- .../plugins/ftrace_data/default/pagemap.proto | 2 +- .../plugins/ftrace_data/default/power.proto | 2 +- .../plugins/ftrace_data/default/printk.proto | 2 +- .../ftrace_data/default/raw_syscalls.proto | 2 +- .../plugins/ftrace_data/default/rcu.proto | 2 +- .../ftrace_data/default/regulator.proto | 2 +- .../plugins/ftrace_data/default/sched.proto | 2 +- .../plugins/ftrace_data/default/signal.proto | 2 +- .../plugins/ftrace_data/default/sunrpc.proto | 2 +- .../plugins/ftrace_data/default/task.proto | 2 +- .../plugins/ftrace_data/default/timer.proto | 2 +- .../default/trace_plugin_config.proto | 2 +- .../default/trace_plugin_result.proto | 2 +- .../plugins/ftrace_data/default/v4l2.proto | 2 +- .../plugins/ftrace_data/default/vmscan.proto | 2 +- .../ftrace_data/default/workqueue.proto | 2 +- .../ftrace_data/default/writeback.proto | 2 +- .../types/plugins/ftrace_data/dma_fence.proto | 2 +- .../types/plugins/ftrace_data/ext4.proto | 2 +- .../types/plugins/ftrace_data/filelock.proto | 2 +- .../types/plugins/ftrace_data/filemap.proto | 2 +- .../types/plugins/ftrace_data/ftrace.proto | 2 +- .../plugins/ftrace_data/ftrace_event.proto | 2 +- .../types/plugins/ftrace_data/gpio.proto | 2 +- .../types/plugins/ftrace_data/i2c.proto | 2 +- .../types/plugins/ftrace_data/ipi.proto | 2 +- .../types/plugins/ftrace_data/irq.proto | 2 +- .../types/plugins/ftrace_data/kmem.proto | 2 +- .../types/plugins/ftrace_data/net.proto | 2 +- .../types/plugins/ftrace_data/oom.proto | 2 +- .../types/plugins/ftrace_data/pagemap.proto | 2 +- .../types/plugins/ftrace_data/power.proto | 2 +- .../types/plugins/ftrace_data/printk.proto | 2 +- .../plugins/ftrace_data/raw_syscalls.proto | 2 +- .../types/plugins/ftrace_data/rcu.proto | 2 +- .../types/plugins/ftrace_data/sched.proto | 2 +- .../types/plugins/ftrace_data/signal.proto | 2 +- .../types/plugins/ftrace_data/sunrpc.proto | 2 +- .../types/plugins/ftrace_data/task.proto | 2 +- .../types/plugins/ftrace_data/timer.proto | 2 +- .../ftrace_data/trace_plugin_config.proto | 2 +- .../ftrace_data/trace_plugin_result.proto | 2 +- .../types/plugins/ftrace_data/v4l2.proto | 2 +- .../types/plugins/ftrace_data/vmscan.proto | 2 +- .../types/plugins/ftrace_data/workqueue.proto | 2 +- .../types/plugins/ftrace_data/writeback.proto | 2 +- .../protos/types/plugins/hidump_data/BUILD.gn | 2 +- .../hidump_data/hidump_plugin_config.proto | 2 +- .../hidump_data/hidump_plugin_result.proto | 2 +- .../protos/types/plugins/hiebpf_data/BUILD.gn | 2 +- .../hiebpf_data/hiebpf_plugin_config.proto | 2 +- .../protos/types/plugins/hilog_data/BUILD.gn | 2 +- .../hilog_data/hilog_plugin_config.proto | 2 +- .../hilog_data/hilog_plugin_result.proto | 2 +- .../types/plugins/hiperf_call_plugin/BUILD.gn | 2 +- .../hiperf_call_plugin_config.proto | 2 +- .../protos/types/plugins/hiperf_data/BUILD.gn | 2 +- .../hiperf_data/hiperf_plugin_config.proto | 2 +- .../types/plugins/hisysevent_data/BUILD.gn | 2 +- .../hisysevent_plugin_config.proto | 2 +- .../hisysevent_plugin_result.proto | 2 +- .../protos/types/plugins/js_memory/BUILD.gn | 2 +- .../plugins/js_memory/js_heap_config.proto | 2 +- .../plugins/js_memory/js_heap_result.proto | 2 +- .../protos/types/plugins/memory_data/BUILD.gn | 2 +- .../memory_data/memory_plugin_common.proto | 2 +- .../memory_data/memory_plugin_config.proto | 2 +- .../memory_data/memory_plugin_result.proto | 2 +- .../protos/types/plugins/native_hook/BUILD.gn | 2 +- .../native_hook/native_hook_config.proto | 2 +- .../native_hook/native_hook_result.proto | 2 +- .../types/plugins/network_data/BUILD.gn | 2 +- .../network_data/network_plugin_config.proto | 2 +- .../network_data/network_plugin_result.proto | 2 +- .../types/plugins/process_data/BUILD.gn | 2 +- .../process_data/process_plugin_config.proto | 2 +- .../process_data/process_plugin_result.proto | 2 +- .../protos/types/plugins/sample_data/BUILD.gn | 2 +- .../sample_data/sample_plugin_config.proto | 2 +- .../sample_data/sample_plugin_result.proto | 2 +- .../protos/types/plugins/stream_data/BUILD.gn | 2 +- .../stream_data/stream_plugin_config.proto | 2 +- .../stream_data/stream_plugin_result.proto | 2 +- .../protos/types/plugins/test_data/BUILD.gn | 2 +- .../protos/types/plugins/test_data/test.proto | 2 +- trace_streamer/src/rpc/ffrt_converter.cpp | 262 ++-- trace_streamer/src/rpc/ffrt_converter.h | 49 +- trace_streamer/src/rpc/rpc_server.cpp | 4 +- trace_streamer/src/rpc/rpc_server.h | 4 +- trace_streamer/src/rpc/wasm_func.cpp | 4 +- trace_streamer/src/rpc/wasm_func.h | 4 +- trace_streamer/src/table/BUILD.gn | 2 +- trace_streamer/src/table/base/BUILD.gn | 2 +- trace_streamer/src/table/base/args_table.cpp | 6 +- .../src/table/base/data_dict_table.cpp | 4 +- .../src/table/base/data_type_table.cpp | 4 +- .../table/base/datasource_clockid_table.cpp | 4 +- .../src/table/base/device_info_table.cpp | 4 +- .../src/table/base/include/args_table.h | 4 +- .../src/table/base/include/data_dict_table.h | 4 +- .../src/table/base/include/data_type_table.h | 4 +- .../base/include/datasource_clockid_table.h | 4 +- .../table/base/include/device_info_table.h | 4 +- .../src/table/base/include/meta_table.h | 4 +- .../src/table/base/include/range_table.h | 4 +- .../src/table/base/include/span_join.h | 4 +- .../src/table/base/include/stat_table.h | 4 +- .../src/table/base/include/symbols_table.h | 4 +- .../src/table/base/include/table_base.h | 4 +- .../table/base/include/trace_config_table.h | 4 +- trace_streamer/src/table/base/meta_table.cpp | 4 +- trace_streamer/src/table/base/range_table.cpp | 4 +- trace_streamer/src/table/base/span_join.cpp | 4 +- trace_streamer/src/table/base/stat_table.cpp | 4 +- .../src/table/base/symbols_table.cpp | 4 +- trace_streamer/src/table/base/table_base.cpp | 4 +- .../src/table/base/trace_config_table.cpp | 4 +- trace_streamer/src/table/ebpf/BUILD.gn | 2 +- .../table/ebpf/bio_latency_sample_table.cpp | 4 +- .../src/table/ebpf/ebpf_callstack_table.cpp | 4 +- .../table/ebpf/file_system_sample_table.cpp | 4 +- .../ebpf/include/bio_latency_sample_table.h | 4 +- .../table/ebpf/include/ebpf_callstack_table.h | 4 +- .../ebpf/include/file_system_sample_table.h | 4 +- trace_streamer/src/table/ftrace/BUILD.gn | 2 +- .../src/table/ftrace/animation_table.cpp | 4 +- .../src/table/ftrace/app_startup_table.cpp | 4 +- .../src/table/ftrace/callstack_table.cpp | 10 +- .../table/ftrace/clk_event_filter_table.cpp | 4 +- .../table/ftrace/clock_event_filter_table.cpp | 4 +- .../src/table/ftrace/clock_snapshot_table.cpp | 4 +- .../table/ftrace/cpu_measure_filter_table.cpp | 14 +- .../src/table/ftrace/dynamic_frame_table.cpp | 4 +- .../src/table/ftrace/filter_table.cpp | 6 +- .../src/table/ftrace/frame_maps_table.cpp | 6 +- .../src/table/ftrace/frame_slice_table.cpp | 6 +- .../src/table/ftrace/gpu_slice_table.cpp | 6 +- .../table/ftrace/include/animation_table.h | 4 +- .../table/ftrace/include/app_startup_table.h | 4 +- .../table/ftrace/include/callstack_table.h | 4 +- .../ftrace/include/clk_event_filter_table.h | 4 +- .../ftrace/include/clock_event_filter_table.h | 4 +- .../ftrace/include/clock_snapshot_table.h | 4 +- .../ftrace/include/cpu_measure_filter_table.h | 6 +- .../ftrace/include/dynamic_frame_table.h | 4 +- .../src/table/ftrace/include/filter_table.h | 4 +- .../table/ftrace/include/frame_maps_table.h | 4 +- .../table/ftrace/include/frame_slice_table.h | 4 +- .../table/ftrace/include/gpu_slice_table.h | 4 +- .../src/table/ftrace/include/instants_table.h | 4 +- .../src/table/ftrace/include/irq_table.h | 4 +- .../src/table/ftrace/include/measure_table.h | 4 +- .../include/process_measure_filter_table.h | 4 +- .../src/table/ftrace/include/process_table.h | 4 +- .../src/table/ftrace/include/raw_table.h | 4 +- .../table/ftrace/include/sched_slice_table.h | 4 +- .../include/so_static_initalization_table.h | 4 +- .../table/ftrace/include/system_call_table.h | 4 +- .../include/system_event_filter_table.h | 4 +- .../table/ftrace/include/task_pool_table.h | 4 +- .../table/ftrace/include/thread_state_table.h | 4 +- .../src/table/ftrace/include/thread_table.h | 4 +- .../src/table/ftrace/instants_table.cpp | 4 +- trace_streamer/src/table/ftrace/irq_table.cpp | 9 +- .../src/table/ftrace/measure_table.cpp | 26 +- .../ftrace/process_measure_filter_table.cpp | 10 +- .../src/table/ftrace/process_table.cpp | 9 +- trace_streamer/src/table/ftrace/raw_table.cpp | 12 +- .../src/table/ftrace/sched_slice_table.cpp | 26 +- .../ftrace/so_static_initalization_table.cpp | 4 +- .../src/table/ftrace/system_call_table.cpp | 4 +- .../ftrace/system_event_filter_table.cpp | 4 +- .../src/table/ftrace/task_pool_table.cpp | 4 +- .../src/table/ftrace/thread_state_table.cpp | 16 +- .../src/table/ftrace/thread_table.cpp | 22 +- trace_streamer/src/table/hi_sysevent/BUILD.gn | 2 +- .../table/hi_sysevent/device_state_table.cpp | 4 +- .../hi_sysevent/include/device_state_table.h | 4 +- .../include/sysevent_all_event_table.h | 4 +- .../include/sysevent_measure_table.h | 4 +- .../include/sysevent_subkey_table.h | 4 +- .../hi_sysevent/sysevent_all_event_table.cpp | 4 +- .../hi_sysevent/sysevent_measure_table.cpp | 4 +- .../hi_sysevent/sysevent_subkey_table.cpp | 4 +- trace_streamer/src/table/hiperf/BUILD.gn | 2 +- .../hiperf/include/perf_call_chain_table.h | 4 +- .../table/hiperf/include/perf_files_table.h | 4 +- .../table/hiperf/include/perf_report_table.h | 4 +- .../table/hiperf/include/perf_sample_table.h | 4 +- .../table/hiperf/include/perf_thread_table.h | 4 +- .../table/hiperf/perf_call_chain_table.cpp | 4 +- .../src/table/hiperf/perf_files_table.cpp | 4 +- .../src/table/hiperf/perf_report_table.cpp | 4 +- .../src/table/hiperf/perf_sample_table.cpp | 4 +- .../src/table/hiperf/perf_thread_table.cpp | 4 +- trace_streamer/src/table/js_memory/BUILD.gn | 2 +- .../table/js_memory/include/js_config_table.h | 4 +- .../include/js_cpu_profiler_node_table.h | 4 +- .../include/js_cpu_profiler_sample_table.h | 4 +- .../js_memory/include/js_heap_edges_table.h | 4 +- .../js_memory/include/js_heap_files_table.h | 4 +- .../js_memory/include/js_heap_info_table.h | 4 +- .../include/js_heap_location_table.h | 4 +- .../js_memory/include/js_heap_nodes_table.h | 4 +- .../js_memory/include/js_heap_sample_table.h | 4 +- .../js_memory/include/js_heap_string_table.h | 4 +- .../js_heap_trace_function_info_table.h | 4 +- .../include/js_heap_trace_node_table.h | 4 +- .../src/table/js_memory/js_config_table.cpp | 4 +- .../js_memory/js_cpu_profiler_node_table.cpp | 4 +- .../js_cpu_profiler_sample_table.cpp | 4 +- .../table/js_memory/js_heap_edges_table.cpp | 4 +- .../table/js_memory/js_heap_files_table.cpp | 4 +- .../table/js_memory/js_heap_info_table.cpp | 4 +- .../js_memory/js_heap_location_table.cpp | 4 +- .../table/js_memory/js_heap_nodes_table.cpp | 4 +- .../table/js_memory/js_heap_sample_table.cpp | 4 +- .../table/js_memory/js_heap_string_table.cpp | 4 +- .../js_heap_trace_function_info_table.cpp | 4 +- .../js_memory/js_heap_trace_node_table.cpp | 4 +- trace_streamer/src/table/monitor/BUILD.gn | 2 +- .../table/monitor/cpu_usage_info_table.cpp | 4 +- .../src/table/monitor/disk_io_table.cpp | 4 +- .../src/table/monitor/hidump_table.cpp | 4 +- .../monitor/include/cpu_usage_info_table.h | 4 +- .../src/table/monitor/include/disk_io_table.h | 4 +- .../src/table/monitor/include/hidump_table.h | 4 +- .../monitor/include/live_process_table.h | 4 +- .../src/table/monitor/include/log_table.h | 4 +- .../monitor/include/memory_ashmem_table.h | 4 +- .../table/monitor/include/memory_cpu_table.h | 4 +- .../table/monitor/include/memory_dma_table.h | 4 +- .../include/memory_process_gpu_table.h | 4 +- .../monitor/include/memory_profile_table.h | 4 +- .../monitor/include/memory_rs_image_table.h | 4 +- .../monitor/include/memory_window_gpu_table.h | 4 +- .../src/table/monitor/include/network_table.h | 4 +- .../include/paged_memory_sample_table.h | 4 +- .../src/table/monitor/include/smaps_table.h | 4 +- .../src/table/monitor/live_process_table.cpp | 4 +- .../src/table/monitor/log_table.cpp | 4 +- .../src/table/monitor/memory_ashmem_table.cpp | 4 +- .../src/table/monitor/memory_cpu_table.cpp | 4 +- .../src/table/monitor/memory_dma_table.cpp | 4 +- .../monitor/memory_process_gpu_table.cpp | 4 +- .../table/monitor/memory_profile_table.cpp | 4 +- .../table/monitor/memory_rs_image_table.cpp | 4 +- .../table/monitor/memory_window_gpu_table.cpp | 4 +- .../src/table/monitor/network_table.cpp | 4 +- .../monitor/paged_memory_sample_table.cpp | 4 +- .../src/table/monitor/smaps_table.cpp | 4 +- trace_streamer/src/table/native_hook/BUILD.gn | 2 +- .../include/native_hook_frame_table.h | 4 +- .../include/native_hook_statistic_table.h | 4 +- .../native_hook/include/native_hook_table.h | 4 +- .../native_hook/native_hook_frame_table.cpp | 4 +- .../native_hook_statistic_table.cpp | 4 +- .../table/native_hook/native_hook_table.cpp | 4 +- trace_streamer/src/trace_data/BUILD.gn | 2 +- .../trace_data/sqllite_prepar_cache_data.cpp | 4 +- .../trace_data/sqllite_prepar_cache_data.h | 6 +- .../src/trace_data/trace_data_cache.cpp | 55 +- .../src/trace_data/trace_data_cache.h | 8 +- .../src/trace_data/trace_data_cache_base.cpp | 4 +- .../src/trace_data/trace_data_cache_base.h | 4 +- .../trace_data/trace_data_cache_reader.cpp | 6 +- .../src/trace_data/trace_data_cache_reader.h | 6 +- .../trace_data/trace_data_cache_writer.cpp | 7 +- .../src/trace_data/trace_data_cache_writer.h | 4 +- .../src/trace_data/trace_data_db.cpp | 86 +- trace_streamer/src/trace_data/trace_data_db.h | 14 +- .../trace_data/trace_stdtype/base_stdtype.cpp | 4 +- .../trace_data/trace_stdtype/base_stdtype.h | 6 +- .../trace_stdtype/common_stdtype.cpp | 4 +- .../trace_data/trace_stdtype/common_stdtype.h | 4 +- .../ftrace/callstack_stdtype.cpp | 10 +- .../trace_stdtype/ftrace/callstack_stdtype.h | 11 +- .../ftrace/render_service_stdtype.cpp | 21 +- .../ftrace/render_service_stdtype.h | 21 +- .../trace_stdtype/ftrace/sched_stdtype.cpp | 10 +- .../trace_stdtype/ftrace/sched_stdtype.h | 31 +- .../trace_stdtype/ftrace/syscall_stdtype.cpp | 4 +- .../trace_stdtype/ftrace/syscall_stdtype.h | 4 +- .../ftrace/template/animation_stdtype.cpp | 4 +- .../ftrace/template/animation_stdtype.h | 4 +- .../ftrace/template/app_startup_stdtype.cpp | 4 +- .../ftrace/template/app_startup_stdtype.h | 4 +- .../ftrace/template/task_pool_stdtype.cpp | 4 +- .../ftrace/template/task_pool_stdtype.h | 4 +- .../trace_stdtype/hilog/hilog_stdtype.cpp | 4 +- .../trace_stdtype/hilog/hilog_stdtype.h | 4 +- .../trace_stdtype/hiperf/hiperf_stdtype.cpp | 4 +- .../trace_stdtype/hiperf/hiperf_stdtype.h | 4 +- .../hisysevent/hisysevent_stdtype.cpp | 4 +- .../hisysevent/hisysevent_stdtype.h | 4 +- .../htrace/activity_monitor_stdtype.cpp | 4 +- .../htrace/activity_monitor_stdtype.h | 4 +- .../trace_stdtype/htrace/arkts_stdtype.cpp | 4 +- .../trace_stdtype/htrace/arkts_stdtype.h | 4 +- .../trace_stdtype/htrace/ebpf_stdtype.cpp | 4 +- .../trace_stdtype/htrace/ebpf_stdtype.h | 4 +- .../htrace/native_memory_stdtype.cpp | 4 +- .../htrace/native_memory_stdtype.h | 4 +- .../trace_stdtype/measure/measure_stdtype.cpp | 4 +- .../trace_stdtype/measure/measure_stdtype.h | 6 +- .../trace_streamer/trace_streamer_filters.cpp | 5 +- .../trace_streamer/trace_streamer_filters.h | 4 +- .../trace_streamer_selector.cpp | 42 +- .../trace_streamer/trace_streamer_selector.h | 4 +- trace_streamer/src/version.cpp | 8 +- trace_streamer/src/version.h | 4 +- trace_streamer/test.sh | 2 +- trace_streamer/test/BUILD.gn | 3 +- trace_streamer/test/press_test.sh | 2 +- trace_streamer/test/test_fuzzer/README.md | 43 +- .../test/test_fuzzer/bytrace_fuzzer/BUILD.gn | 14 +- .../bytrace_fuzzer/bytrace_fuzzer.cpp | 8 +- .../bytrace_fuzzer/bytrace_fuzzer.h | 4 +- .../test_fuzzer/bytrace_fuzzer/project.xml | 2 +- .../test/test_fuzzer/htrace_fuzzer/BUILD.gn | 14 +- .../htrace_fuzzer/htrace_fuzzer.cpp | 8 +- .../test_fuzzer/htrace_fuzzer/htrace_fuzzer.h | 4 +- .../test_fuzzer/htrace_fuzzer/project.xml | 2 +- .../test/test_fuzzer/selector_fuzzer/BUILD.gn | 14 +- .../test_fuzzer/selector_fuzzer/project.xml | 2 +- .../selector_fuzzer/selector_fuzzer.cpp | 8 +- .../selector_fuzzer/selector_fuzzer.h | 4 +- trace_streamer/test/test_ts.gni | 3 +- .../test/unittest/base/export_test.cpp | 2 +- .../test/unittest/base/export_test.h | 4 +- .../unittest/filter/animation_filter_test.cpp | 4 +- .../unittest/filter/app_start_filter_test.cpp | 4 +- .../unittest/filter/binder_filter_test.cpp | 4 +- .../unittest/filter/clock_filter_test.cpp | 4 +- .../test/unittest/filter/cpu_filter_test.cpp | 4 +- .../unittest/filter/filter_filter_test.cpp | 4 +- .../unittest/filter/frame_filter_test.cpp | 4 +- .../test/unittest/filter/irq_filter_test.cpp | 4 +- .../unittest/filter/measure_filter_test.cpp | 4 +- .../unittest/filter/process_filter_test.cpp | 4 +- .../unittest/filter/slice_filter_test.cpp | 4 +- .../unittest/filter/task_pool_filter_test.cpp | 4 +- .../htrace/arkts/js_cpu_profiler_test.cpp | 4 +- .../unittest/htrace/arkts/js_memory_test.cpp | 4 +- .../unittest/htrace/ebpf/bio_parser_test.cpp | 4 +- .../htrace/ebpf/ebpf_file_system_test.cpp | 4 +- .../unittest/htrace/ebpf/ebpf_parser_test.cpp | 4 +- .../htrace/ebpf/paged_memory_parser_test.cpp | 4 +- .../unittest/htrace/hidump_parser_test.cpp | 4 +- .../unittest/htrace/hilog_parser_test.cpp | 4 +- .../htrace/hisys_event_parser_test.cpp | 4 +- .../htrace/htrace_binder_event_test.cpp | 4 +- .../htrace/htrace_cpu_data_parser_test.cpp | 4 +- .../htrace/htrace_cpu_detail_parser_test.cpp | 4 +- .../htrace/htrace_diskio_parser_test.cpp | 4 +- .../htrace/htrace_event_parser_test.cpp | 4 +- .../unittest/htrace/htrace_irq_event_test.cpp | 4 +- .../htrace/htrace_mem_parser_test.cpp | 4 +- .../htrace/htrace_network_parser_test.cpp | 4 +- .../htrace/htrace_process_parser_test.cpp | 4 +- .../htrace/htrace_sys_mem_parser_test.cpp | 4 +- .../htrace/htrace_sys_vmem_parser_test.cpp | 4 +- .../native_memory/native_hook_parser_test.cpp | 4 +- .../unittest/htrace/smaps_parser_test.cpp | 4 +- .../unittest/interface/rpc_server_test.cpp | 4 +- .../interface/split_file_data_test.cpp | 4 +- .../unittest/interface/wasm_func_test.cpp | 4 +- .../pbreader/parser_pbreader_test.cpp | 4 +- .../unittest/pbreader/proto_reader_test.cpp | 4 +- .../test/unittest/query/query_file_test.cpp | 4 +- .../unittest/query/query_metrics_test.cpp | 4 +- .../test/unittest/query/span_join_test.cpp | 4 +- .../query/sqllite_prepar_cache_data_test.cpp | 4 +- .../rawtrace/ftrace_field_processor_test.cpp | 4 +- .../rawtrace_cpu_detail_parse_test.cpp | 4 +- .../rawtrace/rawtrace_parser_test.cpp | 4 +- .../unittest/systrace/bytrace_parser_test.cpp | 4 +- .../unittest/systrace/event_parser_test.cpp | 4 +- .../test/unittest/table/table_test.cpp | 4 +- 1170 files changed, 22529 insertions(+), 8372 deletions(-) create mode 100644 ide/src/base-ui/chart/scatter/LitChartScatter.ts create mode 100644 ide/src/base-ui/chart/scatter/LitChartScatterConfig.ts delete mode 100644 ide/src/base-ui/modal/LitModal.ts create mode 100644 ide/src/trace/bean/BinderProcessThread.ts create mode 100644 ide/src/trace/bean/GpufreqBean.ts create mode 100644 ide/src/trace/bean/StateModle.ts create mode 100644 ide/src/trace/component/SpThirdParty.ts create mode 100644 ide/src/trace/component/chart/SpLTPO.ts create mode 100644 ide/src/trace/component/chart/SpSampleChart.ts create mode 100644 ide/src/trace/component/chart/SpSegmentationChart.ts create mode 100644 ide/src/trace/component/trace/sheet/binder/TabPaneBinderDataCut.ts create mode 100644 ide/src/trace/component/trace/sheet/binder/TabPaneBinders.ts create mode 100644 ide/src/trace/component/trace/sheet/frequsage/TabPaneFreqDataCut.ts create mode 100644 ide/src/trace/component/trace/sheet/gpufreq/TabPaneGpufreqDataCut.ts create mode 100644 ide/src/trace/component/trace/sheet/gpufreq/TabPaneGpufreqUsage.ts create mode 100644 ide/src/trace/component/trace/sheet/sample/TabPaneSampleInstruction.ts create mode 100644 ide/src/trace/component/trace/sheet/sample/TabPaneSampleInstructionDistributions.ts create mode 100644 ide/src/trace/component/trace/sheet/sample/TabPaneSampleInstructionSelection.ts create mode 100644 ide/src/trace/component/trace/sheet/sample/TabPaneSampleInstructionSelectionTotalTime.ts create mode 100644 ide/src/trace/component/trace/sheet/schedswitch/TabPaneSchedSwitch.ts create mode 100644 ide/src/trace/component/trace/sheet/states/TabPaneFreqStatesDataCut.ts create mode 100644 ide/src/trace/database/data-trafic/LostFrameReceiver.ts create mode 100644 ide/src/trace/database/data-trafic/LostFrameSender.ts create mode 100644 ide/src/trace/database/sql/Ltpo.sql.ts create mode 100644 ide/src/trace/database/ui-worker/ProcedureWorkerHitchTime.ts create mode 100644 ide/src/trace/database/ui-worker/ProcedureWorkerLTPO.ts create mode 100644 ide/src/trace/database/ui-worker/ProcedureWorkerSample.ts create mode 100644 ide/src/trace/database/ui-worker/procedureWorkerBinder.ts delete mode 100644 ide/test/base-ui/modal/LitModal.test.ts create mode 100644 ide/test/trace/component/chart/SpAllAppStartups.test.ts create mode 100644 ide/test/trace/component/chart/SpLtpoChart.test.ts delete mode 100644 ide/test/trace/component/trace/sheet/binder/TabPaneBinder.test.ts delete mode 100644 ide/test/trace/component/trace/sheet/binder/TabPaneBinderDataCut.test.ts delete mode 100644 ide/test/trace/component/trace/sheet/frequsage/TabPaneFreqDataCut.test.ts delete mode 100644 ide/test/trace/component/trace/sheet/gpufreq/tabPaneGpufreqDataCut.test.ts delete mode 100644 ide/test/trace/component/trace/sheet/gpufreq/tabPaneGpufreqUsage.test.ts delete mode 100644 ide/test/trace/component/trace/sheet/schedswitch/TabPaneSchedSwitch.test.ts create mode 100644 ide/test/trace/database/data-trafic/AbilityMonitorReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/AbilityMonitorSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/ArkTsReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/ArkTsSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/ClockDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/ClockDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/CpuDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/CpuDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/EBPFReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/EBPFSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/EnergySysEventReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/EnergySysEventSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/FrameDynamicEffectReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/FrameDynamicEffectSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/FrameJanksReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/FrameJanksSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/HiSysEventDataReciver.test.ts create mode 100644 ide/test/trace/database/data-trafic/HiSysEventDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/IrqDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/IrqDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/LogDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/LogDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/NativeMemoryDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/NativeMemoryDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/VirtualMemoryDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/VirtualMemoryDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/VmTrackerDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/VmTrackerDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/cpu/CpuFreqDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/cpu/CpuFreqDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/cpu/CpuFreqLimitDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/cpu/CpuFreqLimitDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/cpu/CpuStateReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/cpu/CpuStateSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/hiperf/HiperfCallChartReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/hiperf/HiperfCpuDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/hiperf/HiperfCpuDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/hiperf/HiperfProcessDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/hiperf/HiperfProcessDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/hiperf/HiperfThreadDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/hiperf/HiperfThreadDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/FuncDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/FuncDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessActualDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessActualDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessDeliverInputEventDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessDeliverInputEventDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessExpectedDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessExpectedDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessMemDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessMemDataSender.test.ts rename ide/test/{base-ui/chart/scatter/LitChartScatter.test.ts => trace/database/data-trafic/process/ProcessSoInitDataReceiver.test.ts} (42%) create mode 100644 ide/test/trace/database/data-trafic/process/ProcessSoInitDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessStartupDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ProcessStartupDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ThreadDataReceiver.test.ts create mode 100644 ide/test/trace/database/data-trafic/process/ThreadDataSender.test.ts create mode 100644 ide/test/trace/database/data-trafic/utils/DataFilter.test.ts create mode 100644 ide/test/trace/database/ui-worker/ProcedureWorkerAllAppStartup.test.ts create mode 100644 ide/test/trace/database/ui-worker/ProcedureWorkerFreqExtend.test.ts create mode 100644 ide/test/trace/database/ui-worker/ProcedureWorkerHiPerfCallChart.test.ts create mode 100644 ide/test/trace/database/ui-worker/ProcedureWorkerHiSysEvent.test.ts create mode 100644 ide/test/trace/database/ui-worker/ProcedureWorkerHitchTime.test.ts create mode 100644 ide/test/trace/database/ui-worker/ProcedureWorkerLTPO.test.ts create mode 100644 ide/tsconfig_test.json rename trace_streamer/{gn/.emscripten => mac_depend.sh} (46%) delete mode 100644 trace_streamer/prebuilts/patch_googletest/gtest-message.h.patch create mode 100644 trace_streamer/prebuilts/patch_googletest/gtest.patch delete mode 100644 trace_streamer/prebuilts/patch_googletest/gtest_internal.h.patch delete mode 100644 trace_streamer/prebuilts/patch_googletest/gtest_port.h.patch create mode 100644 trace_streamer/prebuilts/patch_zlib/zlibbuild.gn diff --git a/ide/src/base-ui/chart/scatter/LitChartScatter.ts b/ide/src/base-ui/chart/scatter/LitChartScatter.ts new file mode 100644 index 00000000..2abbb7c2 --- /dev/null +++ b/ide/src/base-ui/chart/scatter/LitChartScatter.ts @@ -0,0 +1,601 @@ +/* + * Copyright (C) 2023 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 { resizeCanvas } from '../helper'; +import { BaseElement, element } from '../../BaseElement'; +import { LitChartScatterConfig } from './LitChartScatterConfig'; + +@element('lit-chart-scatter') +export class LitChartScatter extends BaseElement { + private scatterTipEL: HTMLDivElement | null | undefined; + private labelsEL: HTMLDivElement | null | undefined; + canvas: HTMLCanvasElement | undefined | null; + canvas2: HTMLCanvasElement | undefined | null; + ctx: CanvasRenderingContext2D | undefined | null; + originX: number = 0; + finalX: number = 0; + originY: number = 0; + finalY: number = 0; + options: LitChartScatterConfig | undefined; + + set config(LitChartScatterConfig: LitChartScatterConfig) { + this.options = LitChartScatterConfig; + this.init(); + } + init(): void { + if (this.options) { + // 清楚上一次绘制的数据 + this.ctx?.clearRect(0, 0, this.clientWidth, this.clientHeight); + this.drawBackground(); + this.drawScatterChart(this.options); + //使用off-screen-canvas保存绘制的像素点 + this.setOffScreen(); + this.labelsEL!.innerText = this.options.title; + } + } + // 使用离屏技术保存绘制的像素点 + setOffScreen(): void { + this.canvas2 = document.createElement('canvas'); + this.canvas2.height = this.clientHeight; + this.canvas2.width = this.clientWidth; + let context2: CanvasRenderingContext2D | null = this.canvas2.getContext('2d'); + if (this.canvas?.width !== 0 && this.canvas?.height !== 0) { + context2!.drawImage(this.canvas!, 0, 0); + } + } + /*绘制渐变色背景*/ + drawBackground(): void { + let w: number = this.clientWidth; + let h: number = this.clientHeight; + let color: CanvasGradient = this.ctx?.createRadialGradient( + w / 2, + h / 2, + 0.2 * w, + w / 2, + h / 2, + 0.5 * w + )!; + color?.addColorStop(0, '#eaeaea'); + color?.addColorStop(1, '#ccc'); + if (this.options) { + this.options!.globalGradient = color; + } + this.ctx?.save(); + this.ctx!.fillStyle = color; + this.ctx?.fillRect(0, 0, w, h); + this.ctx?.restore(); + } + /** + * 绘制散点图 + */ + drawScatterChart(options: LitChartScatterConfig): void { + this.drawAxis(options); //绘制坐标轴 + this.drawYLabels(options); //绘制y轴坐标 + this.drawXLabels(options); //绘制x轴坐标 + let drawload: boolean = false; + if (options) { + drawload = options.drawload; + } + if (drawload) { + let load: Array = []; + if (options) { + load = options.load; + this.drawBalanceLine(load); //绘制均衡线 + this.drawLoadLine(load); //绘制最大负载线 + } + } + this.drawData(options); //绘制散点图 + } + /** + * 绘制坐标轴 + */ + drawAxis(options: LitChartScatterConfig): void { + let text: Array = new Array(); + if (options) { + text = options.axisLabel; + } + this.ctx!.font = '10px KATTI'; + this.ctx!.fillStyle = '#000000'; + this.ctx!.strokeStyle = '#000000'; + // 画x轴 + this.ctx?.beginPath(); + this.ctx?.moveTo(this.originX, this.originY); + this.ctx?.lineTo(this.finalX, this.originY); + this.ctx?.fillText(text[0], this.finalX, this.originY); + this.ctx?.stroke(); + // 画Y轴 + this.ctx?.beginPath(); + this.ctx?.moveTo(this.originX, this.originY); + this.ctx?.lineTo(this.originX, this.finalY); + this.ctx?.fillText(text[1], this.originX - 20, this.finalY - 10); + this.ctx?.stroke(); + } + /** + * 绘制y轴坐标 + */ + drawYLabels(options: LitChartScatterConfig): void { + const AXAIS_DELTA: number = 5; + const QUYU: number = 100; + // 添加原点刻度 + this.ctx!.font = '12px KATTI'; + this.ctx!.fillStyle = '#000000'; + this.ctx!.strokeStyle = '#000000'; + this.ctx?.fillText('0', this.originX - AXAIS_DELTA, this.originY + AXAIS_DELTA * 2); + let yAxis: Array = []; + if (options) { + yAxis = options.yAxisLabel; + } + // 画Y轴坐标尺 + for (let i = 0; i < yAxis.length; i++) { + let length1: number = + (this.originY - this.finalY - ((this.originY - this.finalY) % QUYU)) * + (yAxis[i] / yAxis[yAxis.length - 1]); + let length2: number = this.originY - length1; + let text: string = yAxis[i].toString(); + let x: number = this.originX - this.ctx?.measureText(text).width! - AXAIS_DELTA; + this.ctx?.beginPath(); + this.ctx?.moveTo(this.originX, length2); + this.ctx?.lineTo(this.originX + AXAIS_DELTA, length2); + this.ctx?.fillText(text, x, length2 + AXAIS_DELTA); + this.ctx?.stroke(); + } + } + /** + * 绘制x轴坐标 + */ + drawXLabels(options: LitChartScatterConfig): void { + // 画X轴坐标尺 + this.ctx!.fillStyle = '#000000'; + this.ctx!.strokeStyle = '#000000'; + const QUYU: number = 100; + const DELTA: number = 5; + let xAxis: Array = []; + if (options) { + xAxis = options.xAxisLabel; + } + for (let i = 0; i < xAxis.length; i++) { + let length3: number = + (this.finalX - this.originX - ((this.finalX - this.originX) % QUYU)) * + (xAxis[i] / xAxis[xAxis.length - 1]); + let length4: number = this.originX + length3; + this.ctx?.beginPath(); + this.ctx?.moveTo(length4, this.originY); + this.ctx?.lineTo(length4, this.originY - DELTA); + this.ctx?.fillText(xAxis[i].toString(), length4 - DELTA * 3, this.originY + DELTA * 2); + this.ctx?.stroke(); + } + } + + /** + * 绘制数据 + */ + drawData(options: LitChartScatterConfig): void { + let data: Array>> = []; + let yAxis: Array = []; + let xAxis: Array = []; + let colorPool: Array = new Array(); + let colorPoolText: Array = new Array(); + let rectY: number = this.clientHeight * 0.05; + const QUYU: number = 100; + const WIDTH_DELTA: number = 70; + if (options) { + data = options.data; + yAxis = options.yAxisLabel; + xAxis = options.xAxisLabel; + colorPool = options.colorPool(); + colorPoolText = options.colorPoolText(); + options.paintingData = []; + } + let xLength: number = this.finalX - this.originX - ((this.finalX - this.originX) % QUYU); + let yLength: number = this.originY - this.finalY - ((this.originY - this.finalY) % QUYU); + for (let i = 0; i < data.length; i++) { + for (let j = 0; j < data[i].length; j++) { + // 打点x坐标 + let x: number = this.originX + (data[i][j][0] / xAxis[xAxis.length - 1]) * xLength; + // 打点y坐标 + let y: number = this.originY - (data[i][j][1] / yAxis[yAxis.length - 1]) * yLength; + let r: number = 6; + if (i > 0) { + options.paintingData[data[i][j][2] - 1] = { + x, + y, + r, + c: data[i][j], + color: colorPool[i], + }; + } else { + options.paintingData.push({ + x, + y, + r, + c: data[i][j], + color: colorPool[i], + }); + } + this.drawCycle(x, y, r, 0.8, colorPool[i]); + } + if (data[i].length) { + rectY = rectY + 20; + this.ctx?.fillText(colorPoolText[i] + ': ', this.clientWidth - WIDTH_DELTA, rectY + 4); + this.drawCycle(this.clientWidth - (QUYU / 5), rectY, 7.5, 0.8, colorPool[i]); + } + } + } + /** + * 画圆点 + */ + drawCycle( + x: number, + y: number, + r: number, + transparency: number, + color: string + ): void { + this.ctx!.fillStyle = color; + this.ctx?.beginPath(); + this.ctx!.globalAlpha = transparency; + this.ctx?.arc(x, y, r, 0, Math.PI * 2, true); + this.ctx?.closePath(); + this.ctx?.fill(); + } + + /** + * 绘制最大负载线 + */ + drawLoadLine(data: Array): void { + let maxXAxis: number = 1; + const QUYU: number = 100; + const FOR_VALUE = 60; + if (this.options) { + maxXAxis = this.options.xAxisLabel[this.options.xAxisLabel.length - 1]; + } + // data[1]用来标注n Hz负载线 + let addr1: number = + this.originX + + (this.finalX - this.originX - ((this.finalX - this.originX) % QUYU)) * + (data[0] / maxXAxis); + let addr2: number = + (this.originY - this.finalY - ((this.originY - this.finalY) % QUYU)) / FOR_VALUE; + let y: number = this.originY; + this.ctx!.strokeStyle = '#ff0000'; + for (let i = 0; i < FOR_VALUE; i++) { + this.ctx?.beginPath(); + this.ctx?.moveTo(addr1, y); + y -= addr2; + this.ctx?.lineTo(addr1, y); + if (i % 2 !== 0) { + this.ctx?.stroke(); + } + } + this.ctx!.font = '10px KATTI'; + this.ctx!.fillStyle = '#ff0000'; + this.ctx?.fillText( + data[1] + 'Hz最大负载线', + addr1 - FOR_VALUE / 3, + this.originY - addr2 * FOR_VALUE - FOR_VALUE / 4 + ); + this.ctx!.fillStyle = '#000000'; + this.ctx?.fillText('过供给区', addr1 / 2, y + FOR_VALUE / 2); + this.ctx?.fillText('欠供给区', addr1 / 2, this.originY - this.finalY); + this.ctx?.fillText( + '超负载区', + addr1 + FOR_VALUE / 3, + (this.finalY + this.originY) / 2 + ); + } + + /** + * 绘制均衡线 + */ + drawBalanceLine(data: Array): void { + let maxXAxis: number = 1; + const QUYU: number = 100; + const FOR_VALUE = 60; + if (this.options) { + maxXAxis = this.options.xAxisLabel[this.options.xAxisLabel.length - 1]; + } + // data[1]用来标注n Hz均衡线 + let addr1: number = + ((this.finalX - this.originX - ((this.finalX - this.originX) % QUYU)) * + (data[0] / maxXAxis)) / FOR_VALUE; + let addr2: number = + (this.originY - this.finalY - ((this.originY - this.finalY) % QUYU)) / FOR_VALUE; + let x: number = this.originX; + let y: number = this.originY; + this.ctx!.strokeStyle = '#00ff00'; + for (let i = 0; i < FOR_VALUE; i++) { + this.ctx?.beginPath(); + this.ctx?.moveTo(x, y); + x += addr1; + y -= addr2; + this.ctx?.lineTo(x, y); + if (i % 2 === 0) { + this.ctx?.stroke(); + } + } + this.ctx?.save(); + this.ctx?.translate(addr1 * 25 + this.originX, addr2 * 40 + this.finalY); + this.ctx!.font = '10px KATTI'; + this.ctx!.fillStyle = '#ff0f00'; + this.ctx?.rotate(-Math.atan(addr2 / addr1)); + this.ctx?.fillText(data[1] + 'Hz均衡线', 0, 0); + this.ctx?.restore(); + } + + /*检测是否hover在散点之上*/ + checkHover( + options: LitChartScatterConfig | undefined, + pos: Object + ): Object | boolean { + let data: Array = []; + if (options) { + data = options.paintingData; + } + let found: boolean | Object = false; + for (let i = 0; i < data.length; i++) { + found = false; + // @ts-ignore + if ( + Math.sqrt( + // @ts-ignore + Math.pow(pos.x - data[i].x, 2) + Math.pow(pos.y - data[i].y, 2) + // @ts-ignore + ) < data[i].r + ) { + found = data[i]; + break; + } + } + return found; + } + + /*绘制hover状态*/ + paintHover(): void { + let obj: Object | null = this.options!.hoverData; + // @ts-ignore + let x: number = obj?.x; + // @ts-ignore + let y: number = obj?.y; + // @ts-ignore + let r: number = obj?.r; + // @ts-ignore + let c: string = obj?.color; + let step: number = 0.5; + this.ctx!.globalAlpha = 1; + this.ctx!.fillStyle = c; + for (let i = 0; i < 10; i++) { + this.ctx?.beginPath(); + this.ctx?.arc(x, y, r + i * step, 0, 2 * Math.PI, false); + this.ctx?.fill(); + this.ctx?.closePath(); + } + } + //利用离屏canvas恢复hover前的状态 + resetHoverWithOffScreen(): void { + let obj: Object | null = null; + const STEP_VALUE: number = 12; + const OUT_CYCLE: number = 2; + if (this.options) { + obj = this.options.hoverData; + } + if (!obj) { + return; + } + // @ts-ignore + let { x, y, r, c, color } = obj; + let step = 0.5; + this.ctx!.globalAlpha = 1; + for (let i = 10; i > 0; i--) { + this.ctx?.save(); + //绘制外圆范围 + this.ctx?.drawImage( + this.canvas2!, + x - r - STEP_VALUE * step, + y - r - STEP_VALUE * step, + OUT_CYCLE * (r + STEP_VALUE * step), + OUT_CYCLE * (r + STEP_VALUE * step), + x - r - STEP_VALUE * step, + y - r - STEP_VALUE * step, + OUT_CYCLE * (r + STEP_VALUE * step), + OUT_CYCLE * (r + STEP_VALUE * step) + ); + //绘制内圆 + this.ctx?.beginPath(); + this.ctx?.arc(x, y, r + i * step, 0, OUT_CYCLE * Math.PI, false); + this.ctx?.closePath(); + this.ctx!.fillStyle = color; + this.ctx!.globalAlpha = 0.8; + //填充内圆 + this.ctx?.fill(); + this.ctx?.restore(); + } + this.options!.hoverData = null; + } + /** + * 显示提示框 + */ + showTip(data: any): void { + const Y_DELTA: number = 70; + this.scatterTipEL!.style.display = 'flex'; + this.scatterTipEL!.style.top = `${data.y - Y_DELTA}px`; + this.scatterTipEL!.style.left = `${data.x}px`; + this.scatterTipEL!.innerHTML = this.options!.tip(data); + // @ts-ignore + this.options!.hoverEvent('CPU-FREQ', true, data.c[2] - 1); + } + /** + * 隐藏提示框 + */ + hideTip(): void { + this.scatterTipEL!.style.display = 'none'; + if (this.options) { + // @ts-ignore + this.options!.hoverEvent('CPU-FREQ', false); + } + } + + connectedCallback(): void { + super.connectedCallback(); + this.canvas = this.shadowRoot!.querySelector('#canvas'); + this.scatterTipEL = this.shadowRoot!.querySelector('#tip'); + this.ctx = this.canvas!.getContext('2d', { alpha: true }); + this.labelsEL = this.shadowRoot!.querySelector('#shape'); + resizeCanvas(this.canvas!); + this.originX = this.clientWidth * 0.1; + this.originY = this.clientHeight * 0.9; + this.finalX = this.clientWidth; + this.finalY = this.clientHeight * 0.1; + /*hover效果*/ + this.canvas!.onmousemove = (event) => { + let pos: Object = { + x: event.offsetX, + y: event.offsetY, + }; + let hoverPoint: Object | boolean = this.checkHover(this.options, pos); + /** + * 如果当前有聚焦点 + */ + if (hoverPoint) { + this.showTip(hoverPoint); + let samePoint: boolean = + this.options!.hoverData === hoverPoint ? true : false; + if (!samePoint) { + this.resetHoverWithOffScreen(); + this.options!.hoverData = hoverPoint; + } + this.paintHover(); + } else { + //使用离屏canvas恢复 + this.resetHoverWithOffScreen(); + this.hideTip(); + } + }; + } + + initElements(): void { + new ResizeObserver((entries, observer) => { + entries.forEach((it) => { + resizeCanvas(this.canvas!); + this.originX = this.clientWidth * 0.1; + this.originY = this.clientHeight * 0.95; + this.finalX = this.clientWidth * 0.9; + this.finalY = this.clientHeight * 0.1; + this.labelsEL!.innerText = ''; + this.init(); + }); + }).observe(this); + } + + initHtml(): string { + return ` + +
+
+ +
+
+
`; + } +} diff --git a/ide/src/base-ui/chart/scatter/LitChartScatterConfig.ts b/ide/src/base-ui/chart/scatter/LitChartScatterConfig.ts new file mode 100644 index 00000000..eb3b9daa --- /dev/null +++ b/ide/src/base-ui/chart/scatter/LitChartScatterConfig.ts @@ -0,0 +1,45 @@ + +/* + * Copyright (C) 2023 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. + */ +export interface LitChartScatterConfig { + // y轴坐标数组 + yAxisLabel: Array; + // x轴坐标数组 + xAxisLabel: Array; + // 坐标轴名称 + axisLabel: Array; + // 用于判断是否绘制负载线及均衡线 + drawload: boolean; + // 用于存放最大负载线及均衡线的参数值 + load: Array; + // 打点数据 + data: Array>>; + // 用于存放绘图数据 + paintingData: Array; + // 用于存放移入点数据 + hoverData: Object | null; + // 渐变色信息 + globalGradient: CanvasGradient | undefined; + // 颜色池 + colorPool: () => Array; + // 移入事件 + hoverEvent: void; + // 图表名称 + title: string; + // 颜色数据名称 + colorPoolText: () => Array; + // 提示信息 + tip: (a: any) => string; +} diff --git a/ide/src/base-ui/drawer/LitDrawer.ts b/ide/src/base-ui/drawer/LitDrawer.ts index b0893006..3c038ff5 100644 --- a/ide/src/base-ui/drawer/LitDrawer.ts +++ b/ide/src/base-ui/drawer/LitDrawer.ts @@ -14,9 +14,8 @@ */ import { BaseElement, element } from '../BaseElement'; +import { replacePlaceholders } from '../utils/Template'; -let contentPadding = ''; -let contentWidth = ''; let css = ` -` - -const initHtmlStyle = (wid: string) => { - width = wid; - return css; -} - -@element('lit-modal') -export class LitModal extends BaseElement { - private headerTitleElement: HTMLElement | null | undefined; - private headerElement: HTMLElement | null | undefined; - private closeElement: HTMLElement | null | undefined; - private cancelElement: HTMLElement | null | undefined; - private okElement: HTMLElement | null | undefined; - private modalElement: HTMLElement | null | undefined; - private resizing: boolean = false; - private down: boolean = false; - private onmouseleaveMoveFunc: any; - private onmouseupFunc: any; - private onmousedownMoveFunc: any; - private onmousedownFunc: any; - private onmousemoveMoveFunc: any; - private onmousemoveFunc: any; - private onmouseupMoveFunc: any; - static get observedAttributes() { - return [ - 'title', //标题 - 'line', //body的线条 - 'visible', //是否显示modal窗口 - 'ok-text', //确定文本 - 'cancel-text', //取消文本 - 'moveable', //设置窗口是否可以鼠标拖动 - 'resizeable', //窗口可改变大小 - 'width', //modal宽度 - ]; - } - - get okText() { - return this.getAttribute('ok-text') || '确定'; - } - - set okText(value) { - this.setAttribute('ok-text', value); - } - - get cancelText() { - return this.getAttribute('cancel-text') || '取消'; - } - - set cancelText(value) { - this.setAttribute('cancel-text', value); - } - - get title() { - return this.getAttribute('title') || ''; - } - - set title(value) { - this.setAttribute('title', value); - } - - get visible() { - return this.hasAttribute('visible'); - } - - set visible(value) { - if (value) { - this.setAttribute('visible', ''); - } else { - this.removeAttribute('visible'); - } - } - - get width() { - return this.getAttribute('width') || '500px'; - } - - set width(value) { - this.setAttribute('width', value); - } - - get resizeable() { - return this.hasAttribute('resizeable'); - } - - set resizeable(value) { - if (value) { - this.setAttribute('resizeable', ''); - } else { - this.removeAttribute('resizeable'); - } - } - - get moveable() { - return this.hasAttribute('moveable'); - } - - set moveable(value) { - if (value) { - this.setAttribute('moveable', ''); - } else { - this.removeAttribute('moveable'); - } - } - - set onOk(fn: any) { - this.addEventListener('onOk', fn); - } - - set onCancel(fn: any) { - this.addEventListener('onCancel', fn); - } - - initHtml(): string { - return ` - ${initHtmlStyle(this.width)} - - `; - } - - //当 custom element首次被插入文档DOM时,被调用。 - initElements(): void { - this.headerTitleElement = this.shadowRoot!.querySelector('#modal-title'); - this.headerTitleElement!.textContent = this.title; - this.headerElement = this.shadowRoot!.querySelector('.header'); - this.closeElement = this.shadowRoot!.querySelector('.close-icon'); - this.cancelElement = this.shadowRoot!.querySelector('#cancel'); - this.okElement = this.shadowRoot!.querySelector('#ok'); - this.closeElement!.onclick = (ev) => (this.visible = false); - this.modalElement = this.shadowRoot!.querySelector('.modal'); - this.shadowRoot!.querySelector('.modal')!.onclick = (e) => { - e.stopPropagation(); - }; - this.setClick(); - if (this.moveable || this.resizeable) { - if (this.resizeable) { - let resizeWidth = 8; - this.resizing = false; - let srcResizeClientX = 0, - srcResizeClientY = 0, - srcResizeRect, - srcResizeHeight = 0, - srcResizeWidth = 0, - srcResizeRight = 0, - srcResizeLeft = 0, - srcResizeTop = 0; - let direction: string; - this.onmousemoveFunc = (e: any) => { - e.stopPropagation(); - srcResizeRect = this.modalElement!.getBoundingClientRect(); - direction = this.onmousemoveFuncRule(direction,e,srcResizeRect,resizeWidth); - this.resizingFunc(direction,e,srcResizeClientX,srcResizeClientY,srcResizeHeight,srcResizeWidth,srcResizeLeft,srcResizeTop); - }; - this.setOnmousedownFunc(resizeWidth); - this.onmouseupFunc = (e: any) => { - this.resizing = false; - }; - } - this.buildFunc(); - this.onmouseleave = this.onmouseup = (e) => { - if (this.onmouseleaveMoveFunc) this.onmouseleaveMoveFunc(e); - if (this.onmouseupFunc) this.onmouseupFunc(e); - document.body.style.userSelect = ''; - }; - } - } - - setClick():void{ - this.onclick = (ev) => { - ev.stopPropagation(); - if (!this.resizeable) { - this.visible = false; - } - }; - this.cancelElement!.onclick = (ev) => { - this.dispatchEvent(new CustomEvent('onCancel', ev)); - }; - this.okElement!.onclick = (ev) => { - this.dispatchEvent(new CustomEvent('onOk', ev)); - }; - } - - buildFunc():void{ - if (this.moveable) { - this.down = false; - let srcClientX = 0; - let srcClientY = 0; - let srcLeft = 0; - let srcTop = 0; - let srcRight = 0; - let srcBottom = 0; - let clientRect; - let rootRect: any; - this.onmousedownMoveFunc = (e: any) => { - if (this.resizing) return; - srcClientX = e.clientX; - srcClientY = e.clientY; - rootRect = this.getBoundingClientRect(); - clientRect = this.modalElement!.getBoundingClientRect(); - srcLeft = clientRect.left; - srcRight = clientRect.right; - srcTop = clientRect.top; - srcBottom = clientRect.bottom; - if ( - e.clientX > srcLeft + 10 && - e.clientX < srcRight - 10 && - e.clientY > srcTop + 10 && - e.clientY < srcTop + this.headerElement!.scrollHeight - ) { - this.down = true; - } else { - this.down = false; - } - if (this.down) document.body.style.userSelect = 'none'; - this.setOnmousemoveMoveFunc(e, srcClientX, srcClientY, srcLeft, srcTop, srcRight, srcBottom, clientRect, rootRect); - this.onmouseleaveMoveFunc = this.onmouseupMoveFunc = (e: any) => { - this.down = false; - this.headerElement!.style.cursor = ''; - }; - }; - } - this.onmousemove = (e) => { - if (this.onmousemoveFunc) this.onmousemoveFunc(e); - if (this.onmousemoveMoveFunc) this.onmousemoveMoveFunc(e); - }; - this.onmousedown = (e) => { - if (this.onmousedownFunc) this.onmousedownFunc(e); - if (this.onmousedownMoveFunc) this.onmousedownMoveFunc(e); - }; - } - - setOnmousemoveMoveFunc(e:any,srcClientX:number,srcClientY:number,srcLeft:number,srcTop:number,srcRight:number,srcBottom:number,clientRect:any,rootRect:any):void{ - this.onmousemoveMoveFunc = (ev: any) => { - if (this.down) { - let offsetY = e.clientY - srcClientY; - let offsetX = e.clientX - srcClientX; - if (e.clientX > srcLeft + 10 && e.clientX < srcRight - 10 && e.clientY > srcTop + 10) { - this.headerElement!.style.cursor = 'move'; - clientRect = this.modalElement!.getBoundingClientRect(); - //下面 rootRect.height 改成 this.scrollHeight 解决modal 过长会出现滚动条的情况 - if ( - ev.clientY - srcClientY + srcTop > 0 && - ev.clientY - srcClientY + srcTop < this.scrollHeight - clientRect.height - ) { - this.modalElement!.style.top = ev.clientY - srcClientY + srcTop + 'px'; - } else { - if (ev.clientY - srcClientY + srcTop <= 0) { - this.modalElement!.style.top = '0px'; - } else { - //下面 rootRect.height 改成 this.scrollHeight 解决modal 过长会出现滚动条的情况 - this.modalElement!.style.top = this.scrollHeight - clientRect.height + 'px'; - } - } - //ev.clientX-srcClientX 鼠标移动像素 - if ( - ev.clientX - srcClientX + srcLeft > 0 && - ev.clientX - srcClientX + srcLeft < rootRect.width - clientRect.width - ) { - this.modalElement!.style.left = ev.clientX - srcClientX + srcLeft + clientRect.width / 2 + 'px'; - } else { - if (ev.clientX - srcClientX + srcLeft <= 0) { - this.modalElement!.style.left = clientRect.width / 2 + 'px'; - } else { - this.modalElement!.style.left = rootRect.width - clientRect.width + clientRect.width / 2 + 'px'; - } - } - } - } - }; - } - - onmousemoveFuncRule(direction:string,e:any,srcResizeRect:any,resizeWidth:number):string{ - if ( - e.clientX > srcResizeRect.left - resizeWidth && - e.clientX < srcResizeRect.left + resizeWidth && - e.clientY > srcResizeRect.top - resizeWidth && - e.clientY < srcResizeRect.top + resizeWidth - ) { - this.style.cursor = 'nwse-resize'; - if (!this.resizing) return 'left-top'; - } else if ( - e.clientX > srcResizeRect.right - resizeWidth && - e.clientX < srcResizeRect.right + resizeWidth && - e.clientY > srcResizeRect.top - resizeWidth && - e.clientY < srcResizeRect.top + resizeWidth - ) { - this.style.cursor = 'nesw-resize'; - if (!this.resizing) return 'right-top'; - } else if ( - e.clientX > srcResizeRect.left - resizeWidth && - e.clientX < srcResizeRect.left + resizeWidth && - e.clientY > srcResizeRect.bottom - resizeWidth && - e.clientY < srcResizeRect.bottom + resizeWidth - ) { - this.style.cursor = 'nesw-resize'; - if (!this.resizing) return 'left-bottom'; - } else { - return this.funcRuleIf(direction,e,srcResizeRect,resizeWidth); - } - return '' - } - - funcRuleIf(direction:string,e:any,srcResizeRect:any,resizeWidth:number):string{ - if ( - e.clientX > srcResizeRect.right - resizeWidth && - e.clientX < srcResizeRect.right + resizeWidth && - e.clientY > srcResizeRect.bottom - resizeWidth && - e.clientY < srcResizeRect.bottom + resizeWidth - ) { - this.style.cursor = 'nwse-resize'; - if (!this.resizing) return 'right-bottom'; - } else if (e.clientX > srcResizeRect.left - resizeWidth && e.clientX < srcResizeRect.left + resizeWidth) { - this.style.cursor = 'ew-resize'; - if (!this.resizing) return 'left'; - } else if (e.clientX < srcResizeRect.right + resizeWidth && e.clientX > srcResizeRect.right - resizeWidth) { - this.style.cursor = 'ew-resize'; - if (!this.resizing) return 'right'; - } else if (e.clientY > srcResizeRect.top - resizeWidth && e.clientY < srcResizeRect.top + resizeWidth) { - this.style.cursor = 'ns-resize'; - if (!this.resizing) return 'top'; - } else if (e.clientY < srcResizeRect.bottom + resizeWidth && e.clientY > srcResizeRect.bottom - resizeWidth) { - this.style.cursor = 'ns-resize'; - if (!this.resizing) return 'bottom'; - } else { - this.style.cursor = ''; - if (!this.resizing) return ''; - } - return ''; - } - - resizingFunc(direction:string,e:any,srcResizeClientX:number,srcResizeClientY:number,srcResizeHeight:number,srcResizeWidth:number,srcResizeLeft:number,srcResizeTop:number):void{ - if (this.resizing) { - let offsetResizeY = e.clientY - srcResizeClientY; - let offsetResizeX = e.clientX - srcResizeClientX; - if (direction === 'bottom') { - this.modalElement!.style.height = srcResizeHeight + offsetResizeY + 'px'; - } else if (direction === 'top') { - this.modalElement!.style.top = srcResizeTop + offsetResizeY + 'px'; - this.modalElement!.style.height = srcResizeHeight - offsetResizeY + 'px'; - } else if (direction === 'right') { - this.modalElement!.style.left = srcResizeLeft + srcResizeWidth / 2 + offsetResizeX / 2 + 'px'; - this.modalElement!.style.width = srcResizeWidth + offsetResizeX + 'px'; - } else if (direction === 'left') { - this.modalElement!.style.left = srcResizeLeft + srcResizeWidth / 2 + offsetResizeX / 2 + 'px'; - this.modalElement!.style.width = srcResizeWidth - offsetResizeX + 'px'; - } else if (direction === 'left-top') { - this.modalElement!.style.left = srcResizeLeft + srcResizeWidth / 2 + offsetResizeX / 2 + 'px'; - this.modalElement!.style.width = srcResizeWidth - offsetResizeX + 'px'; - this.modalElement!.style.top = srcResizeTop + offsetResizeY + 'px'; - this.modalElement!.style.height = srcResizeHeight - offsetResizeY + 'px'; - } else if (direction === 'right-top') { - this.modalElement!.style.left = srcResizeLeft + srcResizeWidth / 2 + offsetResizeX / 2 + 'px'; - this.modalElement!.style.width = srcResizeWidth + offsetResizeX + 'px'; - this.modalElement!.style.top = srcResizeTop + offsetResizeY + 'px'; - this.modalElement!.style.height = srcResizeHeight - offsetResizeY + 'px'; - } else if (direction === 'left-bottom') { - this.modalElement!.style.left = srcResizeLeft + srcResizeWidth / 2 + offsetResizeX / 2 + 'px'; - this.modalElement!.style.width = srcResizeWidth - offsetResizeX + 'px'; - this.modalElement!.style.height = srcResizeHeight + offsetResizeY + 'px'; - } else if (direction === 'right-bottom') { - this.modalElement!.style.left = srcResizeLeft + srcResizeWidth / 2 + offsetResizeX / 2 + 'px'; - this.modalElement!.style.width = srcResizeWidth + offsetResizeX + 'px'; - this.modalElement!.style.height = srcResizeHeight + offsetResizeY + 'px'; - } - } - } - - setOnmousedownFunc(resizeWidth: number): void { - this.onmousedownFunc = (e: any) => { - const srcResizeRect = this.modalElement!.getBoundingClientRect(); - const { clientX, clientY } = e; - const { left, right, top, bottom, width, height } = srcResizeRect; - const resizeRange = resizeWidth * 2; - - const isWithinRange = (coord: number, target: number, range: number) => - coord > target - range && coord < target + range; - - const isWithinCornerRange = (cornerX: number, cornerY: number) => - isWithinRange(clientX, cornerX, resizeRange) && - isWithinRange(clientY, cornerY, resizeRange); - - const isWithinTopLeft = isWithinCornerRange(left, top); - const isWithinTopRight = isWithinCornerRange(right, top); - const isWithinBottomLeft = isWithinCornerRange(left, bottom); - const isWithinBottomRight = isWithinCornerRange(right, bottom); - - if ( - isWithinTopLeft || - isWithinTopRight || - isWithinBottomLeft || - isWithinBottomRight - ) { - this.resizing = true; - } else { - this.resizeIf(e, srcResizeRect, resizeWidth); - } - - if (this.resizing) { - document.body.style.userSelect = 'none'; - } - }; - } - - resizeIf(e:any,srcResizeRect:any,resizeWidth:number){ - if (e.clientX > srcResizeRect.left - resizeWidth && e.clientX < srcResizeRect.left + resizeWidth) { - this.resizing = true; - } else if (e.clientX < srcResizeRect.right + resizeWidth && e.clientX > srcResizeRect.right - resizeWidth) { - this.resizing = true; - } else if (e.clientY > srcResizeRect.top - resizeWidth && e.clientY < srcResizeRect.top + resizeWidth) { - this.resizing = true; - } else if (e.clientY < srcResizeRect.bottom + resizeWidth && e.clientY > srcResizeRect.bottom - resizeWidth) { - this.resizing = true; - } else { - this.resizing = false; - } - } - - //当 custom element从文档DOM中删除时,被调用。 - disconnectedCallback() {} - - //当 custom element被移动到新的文档时,被调用。 - adoptedCallback() {} - - //当 custom element增加、删除、修改自身属性时,被调用。 - attributeChangedCallback(name: string, oldValue: string, newValue: string) { - if (name === 'visible') { - if (!newValue && this.modalElement) { - this.modalElement.style.top = '100px'; - this.modalElement.style.left = '50%'; - } - } else if (name === 'title' && this.headerTitleElement) { - this.headerTitleElement.textContent = newValue; - } - } -} - -if (!customElements.get('lit-modal')) { - customElements.define('lit-modal', LitModal); -} diff --git a/ide/src/base-ui/popover/LitPopoverV.ts b/ide/src/base-ui/popover/LitPopoverV.ts index 2376d82b..225e84e7 100644 --- a/ide/src/base-ui/popover/LitPopoverV.ts +++ b/ide/src/base-ui/popover/LitPopoverV.ts @@ -14,7 +14,7 @@ */ import { BaseElement, element } from '../BaseElement'; -let width = ''; +import { replacePlaceholders } from '../utils/Template'; let css = ` ` const initHtmlStyle = (wid: string) => { - width = wid; - return css; + return replacePlaceholders(css,wid); }; @element('lit-popover') diff --git a/ide/src/base-ui/select/LitAllocationSelect.ts b/ide/src/base-ui/select/LitAllocationSelect.ts index e1f783fb..10c6d03f 100644 --- a/ide/src/base-ui/select/LitAllocationSelect.ts +++ b/ide/src/base-ui/select/LitAllocationSelect.ts @@ -14,8 +14,8 @@ */ import { BaseElement, element } from '../BaseElement'; +import { replacePlaceholders } from '../utils/Template'; -let listHeight = ''; let css = ` `; const initHtmlStyle = (height: string): string => { - listHeight = height; - return css; + return replacePlaceholders(css, height); }; @element('lit-allocation-select') diff --git a/ide/src/base-ui/select/LitSelectHtml.ts b/ide/src/base-ui/select/LitSelectHtml.ts index dad54d68..47aa38f3 100644 --- a/ide/src/base-ui/select/LitSelectHtml.ts +++ b/ide/src/base-ui/select/LitSelectHtml.ts @@ -13,7 +13,8 @@ * limitations under the License. */ -let listHeight = ''; +import { replacePlaceholders } from '../utils/Template'; + let css = ` `; const initHtmlStyle = (str: string | null, text: string | null) => { - colorStr = str; - colorText = text; - return css; + return replacePlaceholders(css, str!, text!); }; @element('lit-slider') diff --git a/ide/src/base-ui/table/LitPageTable.ts b/ide/src/base-ui/table/LitPageTable.ts index c9d31617..f1022b52 100644 --- a/ide/src/base-ui/table/LitPageTable.ts +++ b/ide/src/base-ui/table/LitPageTable.ts @@ -22,12 +22,13 @@ import { addCopyEventListener, addSelectAllBox, createDownUpSvg, - exportData, fixed, + exportData, + fixed, formatExportData, formatName, iconPadding, iconWidth, - litPageTableHtml + litPageTableHtml, } from './LitTableHtml'; @element('lit-page-table') @@ -199,7 +200,6 @@ export class LitPageTable extends BaseElement { this.tableElement!.scrollLeft = 0; } else { this.tableElement!.scrollTop = 0; - this.tableElement!.scrollLeft = 0; } } @@ -321,9 +321,9 @@ export class LitPageTable extends BaseElement { rowElement.append(h); } }); - }; + } - resolvingAreaColumnOrder(column: any, index: number, key: string,head: any): void { + resolvingAreaColumnOrder(column: any, index: number, key: string, head: any): void { if (column.hasAttribute('order')) { (head as any).sortType = 0; head.classList.add('td-order'); @@ -389,6 +389,13 @@ export class LitPageTable extends BaseElement { this.gridTemplateColumns[i] = `${node.clientWidth}px`; } this.gridTemplateColumns[this.resizeColumnIndex - 1] = `${prePageWidth}px`; + let lastNode = header.childNodes.item(header.childNodes.length - 1) as HTMLDivElement; + let totalWidth = 0; + this.gridTemplateColumns.forEach((it) => { + totalWidth += parseInt(it); + }); + totalWidth = Math.max(totalWidth, this.shadowRoot!.querySelector('.table')!.scrollWidth); + this.gridTemplateColumns[this.gridTemplateColumns.length - 1] = `${totalWidth - lastNode.offsetLeft - 1}px`; header.style.gridTemplateColumns = this.gridTemplateColumns.join(' '); let preNode = header.childNodes.item(this.resizeColumnIndex - 1) as HTMLDivElement; preNode.style.width = `${prePageWidth}px`; @@ -424,12 +431,14 @@ export class LitPageTable extends BaseElement { header.style.cursor = 'pointer'; }); element.addEventListener('mousedown', (event) => { - this.resizeColumnIndex = index; - this.isResize = true; - this.resizeDownX = event.clientX; - let pre = header.childNodes.item(this.resizeColumnIndex - 1) as HTMLDivElement; - this.beforeResizeWidth = pre.clientWidth; - event.stopPropagation(); + if (event.button === 0) { + this.resizeColumnIndex = index; + this.isResize = true; + this.resizeDownX = event.clientX; + let pre = header.childNodes.item(this.resizeColumnIndex - 1) as HTMLDivElement; + this.beforeResizeWidth = pre.clientWidth; + event.stopPropagation(); + } }); element.addEventListener('click', (event) => { event.stopPropagation(); @@ -500,36 +509,36 @@ export class LitPageTable extends BaseElement { addOnScrollListener(visibleObjList: TableRowObject[]): void { this.tableElement && - (this.tableElement.onscroll = (event) => { - let tblScrollTop = this.tableElement!.scrollTop; - let skip = 0; - for (let i = 0; i < visibleObjList.length; i++) { - if ( - visibleObjList[i].top <= tblScrollTop && - visibleObjList[i].top + visibleObjList[i].height >= tblScrollTop - ) { - skip = i; - break; + (this.tableElement.onscroll = (event) => { + let tblScrollTop = this.tableElement!.scrollTop; + let skip = 0; + for (let i = 0; i < visibleObjList.length; i++) { + if ( + visibleObjList[i].top <= tblScrollTop && + visibleObjList[i].top + visibleObjList[i].height >= tblScrollTop + ) { + skip = i; + break; + } } - } - let reduce = this.currentRecycleList.map((item) => item.clientHeight).reduce((a, b) => a + b, 0); - if (reduce == 0) { - return; - } - while ( - reduce <= this.tableElement!.clientHeight && - this.currentRecycleList.length + skip < visibleObjList.length + let reduce = this.currentRecycleList.map((item) => item.clientHeight).reduce((a, b) => a + b, 0); + if (reduce == 0) { + return; + } + while ( + reduce <= this.tableElement!.clientHeight && + this.currentRecycleList.length + skip < visibleObjList.length ) { - let newTableElement = this.createNewTableElement(visibleObjList[skip]); - this.tbodyElement?.append(newTableElement); - this.currentRecycleList.push(newTableElement); - reduce += newTableElement.clientHeight; - } - this.startSkip = skip; - for (let i = 0; i < this.currentRecycleList.length; i++) { - this.freshCurrentLine(this.currentRecycleList[i], visibleObjList[i + skip]); - } - }); + let newTableElement = this.createNewTableElement(visibleObjList[skip]); + this.tbodyElement?.append(newTableElement); + this.currentRecycleList.push(newTableElement); + reduce += newTableElement.clientHeight; + } + this.startSkip = skip; + for (let i = 0; i < this.currentRecycleList.length; i++) { + this.freshCurrentLine(this.currentRecycleList[i], visibleObjList[i + skip]); + } + }); } measureReset(): void { @@ -593,40 +602,40 @@ export class LitPageTable extends BaseElement { addTreeRowScrollListener(): void { this.tableElement && - (this.tableElement.onscroll = (event) => { - let visibleObjs = this.recycleDs.filter((item) => { - return !item.rowHidden; - }); - let top = this.tableElement!.scrollTop; - this.treeElement!.style.transform = `translateY(${top}px)`; - let skip = 0; - for (let index = 0; index < visibleObjs.length; index++) { - if (visibleObjs[index].top <= top && visibleObjs[index].top + visibleObjs[index].height >= top) { - skip = index; - break; + (this.tableElement.onscroll = (event) => { + let visibleObjs = this.recycleDs.filter((item) => { + return !item.rowHidden; + }); + let top = this.tableElement!.scrollTop; + this.treeElement!.style.transform = `translateY(${top}px)`; + let skip = 0; + for (let index = 0; index < visibleObjs.length; index++) { + if (visibleObjs[index].top <= top && visibleObjs[index].top + visibleObjs[index].height >= top) { + skip = index; + break; + } } - } - let reduce = this.currentRecycleList.map((item) => item.clientHeight).reduce((a, b) => a + b, 0); - if (reduce == 0) { - return; - } - while (reduce <= this.tableElement!.clientHeight) { - let newTableElement = this.createNewTreeTableElement(visibleObjs[skip]); - this.tbodyElement?.append(newTableElement); - if (this.treeElement?.lastChild) { - (this.treeElement?.lastChild as HTMLElement).style.height = visibleObjs[skip].height + 'px'; + let reduce = this.currentRecycleList.map((item) => item.clientHeight).reduce((a, b) => a + b, 0); + if (reduce == 0) { + return; } - this.currentRecycleList.push(newTableElement); - reduce += newTableElement.clientHeight; - } - for (let i = 0; i < this.currentRecycleList.length; i++) { - this.freshCurrentLine( - this.currentRecycleList[i], - visibleObjs[i + skip], - this.treeElement?.children[i] as HTMLElement - ); - } - }); + while (reduce <= this.tableElement!.clientHeight) { + let newTableElement = this.createNewTreeTableElement(visibleObjs[skip]); + this.tbodyElement?.append(newTableElement); + if (this.treeElement?.lastChild) { + (this.treeElement?.lastChild as HTMLElement).style.height = visibleObjs[skip].height + 'px'; + } + this.currentRecycleList.push(newTableElement); + reduce += newTableElement.clientHeight; + } + for (let i = 0; i < this.currentRecycleList.length; i++) { + this.freshCurrentLine( + this.currentRecycleList[i], + visibleObjs[i + skip], + this.treeElement?.children[i] as HTMLElement + ); + } + }); } createNewTreeTableElement(rowData: TableRowObject): any { @@ -880,7 +889,7 @@ export class LitPageTable extends BaseElement { if (reduce === 0) { return; } - while (reduce <= this.tableElement!.clientHeight) { + while (reduce <= this.tableElement!.clientHeight + 1) { let rowElement; if (this.hasAttribute('tree')) { rowElement = this.createNewTreeTableElement(visibleObjs[skip]); @@ -917,7 +926,7 @@ export class LitPageTable extends BaseElement { let td: any; td = document.createElement('div'); td.classList.add('td'); - td.style.overflow = 'scroll hidden'; + td.style.overflow = 'hidden'; td.style.textOverflow = 'ellipsis'; td.style.whiteSpace = 'nowrap'; td.dataIndex = dataIndex; @@ -947,6 +956,7 @@ export class LitPageTable extends BaseElement { rowElement.style.position = 'absolute'; rowElement.style.top = '0px'; rowElement.style.left = '0px'; + rowElement.style.height = `${rowData.height}px`; if (this.getItemTextColor) { rowElement.style.color = this.getItemTextColor(rowData.data); } diff --git a/ide/src/base-ui/table/LitTableHtml.ts b/ide/src/base-ui/table/LitTableHtml.ts index a907921b..144d7a7d 100644 --- a/ide/src/base-ui/table/LitTableHtml.ts +++ b/ide/src/base-ui/table/LitTableHtml.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {JSONToCSV} from "../utils/CSVFormater"; +import { JSONToCSV } from '../utils/CSVFormater'; export const iconWidth = 20; export const iconPadding = 5; @@ -37,6 +37,7 @@ export const litPageTableHtml = ` } .tr{ background-color: var(--dark-background,#FFFFFF); + line-height: 27px; } .tr:hover{ background-color: var(--dark-background6,#DEEDFF); @@ -55,6 +56,7 @@ export const litPageTableHtml = ` align-items: center; width: 100%; height: auto; + line-height: 21px; cursor: pointer; } .td label{ @@ -547,7 +549,7 @@ export function createDownUpSvg(index: number, head: any) { downSvg.style.display = 'none'; head.appendChild(upSvg); head.appendChild(downSvg); - return {upSvg, downSvg} + return { upSvg, downSvg }; } export function exportData(that: any): void { @@ -684,4 +686,4 @@ export function formatName(key: string, name: any, that: any): any { return content.toString().replace(//g, '>'); } return ''; -} \ No newline at end of file +} diff --git a/ide/src/base-ui/table/lit-table.ts b/ide/src/base-ui/table/lit-table.ts index e6724e7a..a611a21c 100644 --- a/ide/src/base-ui/table/lit-table.ts +++ b/ide/src/base-ui/table/lit-table.ts @@ -34,7 +34,7 @@ import { addCopyEventListener, addSelectAllBox, fixed, - formatName + formatName, } from './LitTableHtml'; @element('lit-table') @@ -173,26 +173,19 @@ export class LitTable extends HTMLElement { this.tableElement!.scrollLeft = 0; } else { this.tableElement!.scrollTop = 0; - this.tableElement!.scrollLeft = 0; } - if (this.hasAttribute('tree')) { - if (value.length === 0) { - this.value = []; - this.recycleDs = this.meauseTreeRowElement(value); - } else { - if ( - value !== this.value && - this.value.length !== 0 && - !this._isSearch && - this.querySelector('lit-table-column')?.hasAttribute('retract') - ) { + if (this.hasAttribute('tree') && this.querySelector('lit-table-column')?.hasAttribute('retract')) { + if ((value.length === 0 || this.value.length !== 0) && value !== this.value && !this._isSearch) { + if (this.shadowRoot!.querySelector('.top')) { this.shadowRoot!.querySelector('.top')!.name = 'up'; + } + if (this.shadowRoot!.querySelector('.bottom')) { this.shadowRoot!.querySelector('.bottom')!.name = 'down'; } - this._isSearch = false; - this.value = value; - this.recycleDs = this.meauseTreeRowElement(value, RedrawTreeForm.Retract); } + this.value = value; + this._isSearch = false; + this.recycleDs = this.meauseTreeRowElement(value, RedrawTreeForm.Retract); } else { this.recycleDs = this.meauseAllRowHeight(value); } @@ -274,8 +267,14 @@ export class LitTable extends HTMLElement { } }); } - - setStatus(list: any, status: boolean, depth: number = 0): void { + /** + * 设置表格每条数据的展开/收起状态 + * @param list 表格数据 + * @param status 展开/收起状态 + * @param depth 展开深度,用来实现和图标的联动 + * @param profundity 展开深度,用来实现逐级展开 + */ + public setStatus(list: any, status: boolean, depth: number = 0, profundity?: number): void { this.tableElement!.scrollTop = 0; // 添加depth参数,让切换图标的代码在递归中只走一遍 if (depth === 0) { @@ -288,9 +287,19 @@ export class LitTable extends HTMLElement { } } for (let item of list) { - item.status = status; + if (profundity) { + if (depth < profundity) { + item.status = true; + status = true; + } else { + item.status = false; + status = false; + } + } else { + item.status = status; + } if (item.children !== undefined && item.children.length > 0) { - this.setStatus(item.children, status, depth + 1); + this.setStatus(item.children, status, depth + 1, profundity); } } } @@ -384,7 +393,7 @@ export class LitTable extends HTMLElement { rowElement.append(head); } }); - }; + } resolvingAreaColumn(rowElement: HTMLDivElement, column: any, index: number, key: string): HTMLDivElement { let head: any = document.createElement('div'); @@ -456,7 +465,7 @@ export class LitTable extends HTMLElement { } } - resolvingAreaColumnOrder(column: any, index: number, key: string,columnHead: any): void { + resolvingAreaColumnOrder(column: any, index: number, key: string, columnHead: any): void { if (column.hasAttribute('order')) { (columnHead as any).sortType = 0; columnHead.classList.add('td-order'); @@ -512,7 +521,7 @@ export class LitTable extends HTMLElement { private beforeResizeWidth: number = 0; resizeEventHandler(header: HTMLDivElement, element: HTMLDivElement, index: number): void { - this.resizeMouseMoveEventHandler(header); + this.resizeMouseMoveEventHandler(header); header.addEventListener('mouseup', (event) => { if (!this.columnResizeEnable) return; this.isResize = false; @@ -556,11 +565,19 @@ export class LitTable extends HTMLElement { let width = event.clientX - this.resizeDownX; header.style.cursor = 'col-resize'; let preWidth = Math.max(this.beforeResizeWidth + width, this.columnMinWidth); + this.gridTemplateColumns[header.childNodes.length - 1] = '1fr'; for (let i = 0; i < header.childNodes.length; i++) { let node = header.childNodes.item(i) as HTMLDivElement; this.gridTemplateColumns[i] = `${node.clientWidth}px`; } this.gridTemplateColumns[this.resizeColumnIndex - 1] = `${preWidth}px`; + let lastNode = header.childNodes.item(header.childNodes.length - 1) as HTMLDivElement; + let totalWidth = 0; + this.gridTemplateColumns.forEach((it) => { + totalWidth += parseInt(it); + }); + totalWidth = Math.max(totalWidth, this.shadowRoot!.querySelector('.table')!.scrollWidth); + this.gridTemplateColumns[this.gridTemplateColumns.length - 1] = `${totalWidth - lastNode.offsetLeft - 1}px`; header.style.gridTemplateColumns = this.gridTemplateColumns.join(' '); let preNode = header.childNodes.item(this.resizeColumnIndex - 1) as HTMLDivElement; preNode.style.width = `${preWidth}px`; @@ -623,7 +640,7 @@ export class LitTable extends HTMLElement { Math.max(totalHeight, this.tableElement!.scrollTop + headHeight) <= Math.min(totalHeight + height, this.tableElement!.scrollTop + this.tableElement!.clientHeight + headHeight) ) { - let newTableElement = this.addTableElement(tableRowObject, false,false, true, totalHeight); + let newTableElement = this.addTableElement(tableRowObject, false, false, true, totalHeight); let td = newTableElement?.querySelectorAll('.td'); if (tableRowObject.data.rowName === 'cpu-profiler') { td[0].innerHTML = ''; @@ -673,7 +690,7 @@ export class LitTable extends HTMLElement { return; } while (reduce <= this.tableElement!.clientHeight) { - let newTableElement = this.addTableElement(visibleObjects[skip], false,false, false); + let newTableElement = this.addTableElement(visibleObjects[skip], false, false, false); reduce += newTableElement.clientHeight; } for (let i = 0; i < this.currentRecycleList.length; i++) { @@ -683,7 +700,7 @@ export class LitTable extends HTMLElement { return visibleObjects; } - freshLineHandler(index: number, skip: number, visibleObjects: TableRowObject[]){ + freshLineHandler(index: number, skip: number, visibleObjects: TableRowObject[]) { this.freshCurrentLine(this.currentRecycleList[index], visibleObjects[index + skip]); if (visibleObjects[index + skip]) { if (visibleObjects[index + skip].data.rowName === 'cpu-profiler') { @@ -711,10 +728,11 @@ export class LitTable extends HTMLElement { visibleObjects: TableRowObject[], parentNode?: TableRowObject, form?: RedrawTreeForm - ) { + ): number { + let th = totalHeight; let headHeight = this.theadElement?.clientHeight || 0; list.forEach((item) => { - let tableRowObject = this.newTableRowObject(item, totalHeight, depth, parentNode); + let tableRowObject = this.newTableRowObject(item, th, depth, parentNode); if (this._mode === TableMode.Expand && form === RedrawTreeForm.Retract && !item.status) { tableRowObject.expanded = false; } else if (this._mode === TableMode.Expand && form === RedrawTreeForm.Default) { @@ -726,22 +744,23 @@ export class LitTable extends HTMLElement { ) { tableRowObject.expanded = false; if (item.children != undefined && item.children.length > 0) { - this.newTableRowObject(item, totalHeight, depth, tableRowObject); + this.newTableRowObject(item, th, depth, tableRowObject); } } if ( - Math.max(totalHeight, this.tableElement!.scrollTop) <= + Math.max(th, this.tableElement!.scrollTop) <= Math.min( - totalHeight + tableRowObject.height, + th + tableRowObject.height, this.tableElement!.scrollTop + this.tableElement!.clientHeight - headHeight ) ) { - this.addTableElement(tableRowObject,true, false, true, totalHeight); + this.addTableElement(tableRowObject, true, false, true, th); } - totalHeight += tableRowObject.height; + th += tableRowObject.height; visibleObjects.push(tableRowObject); - this.resetAllHeightChildrenHandler(item, depth, totalHeight, visibleObjects, tableRowObject, form); + th = this.resetAllHeightChildrenHandler(item, depth, th, visibleObjects, tableRowObject, form); }); + return th; } resetAllHeightChildrenHandler( @@ -751,13 +770,14 @@ export class LitTable extends HTMLElement { visibleObjects: TableRowObject[], tableRowObject?: TableRowObject, form?: RedrawTreeForm - ) { + ): number { + let th = totalHeight; if (item.hasNext) { // js memory的表格 if (item.parents != undefined && item.parents.length > 0 && item.status) { - this.resetAllHeight(item.parents, depth + 1, totalHeight, visibleObjects, tableRowObject); + th = this.resetAllHeight(item.parents, depth + 1, totalHeight, visibleObjects, tableRowObject); } else if (item.children != undefined && item.children.length > 0 && item.status) { - this.resetAllHeight(item.children, depth + 1, totalHeight, visibleObjects, tableRowObject); + th = this.resetAllHeight(item.children, depth + 1, totalHeight, visibleObjects, tableRowObject); } } else { // 其他数据 @@ -768,11 +788,12 @@ export class LitTable extends HTMLElement { this._mode === TableMode.Expand ) { item.status = true; - this.resetAllHeight(item.children, depth + 1, totalHeight, visibleObjects, tableRowObject); + th = this.resetAllHeight(item.children, depth + 1, totalHeight, visibleObjects, tableRowObject); } else if (item.children != undefined && item.children.length > 0 && item.status) { - this.resetAllHeight(item.children, depth + 1, totalHeight, visibleObjects, tableRowObject); + th = this.resetAllHeight(item.children, depth + 1, totalHeight, visibleObjects, tableRowObject); } } + return th; } measureReset(): void { @@ -787,7 +808,7 @@ export class LitTable extends HTMLElement { this.measureReset(); let visibleObjects: TableRowObject[] = []; let totalHeight = 0; - this.resetAllHeight(list,0, totalHeight, visibleObjects); + totalHeight = this.resetAllHeight(list, 0, totalHeight, visibleObjects); this.tbodyElement && (this.tbodyElement.style.height = totalHeight + 'px'); this.treeElement!.style.height = this.tableElement!.clientHeight - this.theadElement!.clientHeight + 'px'; this.tableElement && @@ -899,8 +920,8 @@ export class LitTable extends HTMLElement { this.currentTreeDivList.forEach((row) => { row.classList.remove('mouse-in'); }); - if (indexOf >= 0 && indexOf < this.treeElement!.children.length) { - this.setMouseIn(true, [this.treeElement?.children[indexOf] as HTMLElement]); + if (indexOf >= 0 && indexOf < this.currentTreeDivList.length) { + this.setMouseIn(true, [this.currentTreeDivList[indexOf]]); } }; rowTreeElement.onmouseleave = () => { @@ -913,6 +934,7 @@ export class LitTable extends HTMLElement { rowTreeElement.onmouseup = (e: MouseEvent) => { let indexOf = this.currentRecycleList.indexOf(rowTreeElement); this.dispatchRowClickEvent(rowData, [this.treeElement?.children[indexOf] as HTMLElement, rowTreeElement], e); + e.stopPropagation(); }; } @@ -957,6 +979,7 @@ export class LitTable extends HTMLElement { td.style.position = 'absolute'; td.style.top = '0px'; td.style.left = '0px'; + td.style.height = `${row.height}px`; this.addFirstElementEvent(td, tr, row); this.setHighLight(row.data.isSearch, td); this.treeElement!.style.width = column.getAttribute('width'); @@ -984,6 +1007,7 @@ export class LitTable extends HTMLElement { td.onmouseup = (e: MouseEvent) => { let indexOf = this.currentTreeDivList.indexOf(td); this.dispatchRowClickEvent(rowData, [td, tr], e); + e.stopPropagation(); }; } @@ -1024,6 +1048,7 @@ export class LitTable extends HTMLElement { }); newTableElement.onmouseup = (e: MouseEvent) => { this.dispatchRowClickEvent(rowData, [newTableElement], e); + e.stopPropagation(); }; newTableElement.onmouseenter = () => { this.dispatchRowHoverEvent(rowData, [newTableElement]); @@ -1151,7 +1176,7 @@ export class LitTable extends HTMLElement { } }; - setChildrenStatus(rowData:any, data: any) { + setChildrenStatus(rowData: any, data: any) { for (let d of data) { if (rowData.data === d) { d.status = false; @@ -1203,7 +1228,8 @@ export class LitTable extends HTMLElement { } reMeauseHeight(): void { - if (this.currentRecycleList.length === 0) { + if (this.currentRecycleList.length === 0 && this.ds.length !== 0) { + this.recycleDataSource = this.ds; return; } let totalHeight = 0; @@ -1317,7 +1343,12 @@ export class LitTable extends HTMLElement { } } - renderTableRowColumnElement(tblColumn: LitTableColumn, tblRowElement: HTMLDivElement, dataIndex: string, rowData: any): void { + renderTableRowColumnElement( + tblColumn: LitTableColumn, + tblRowElement: HTMLDivElement, + dataIndex: string, + rowData: any + ): void { if (tblColumn.template) { // If you customize the rendering, you get the nodes from the template // @ts-ignore @@ -1351,6 +1382,7 @@ export class LitTable extends HTMLElement { renderTableRowElementEvent(tblRowElement: HTMLDivElement, rowData: any): void { tblRowElement.onmouseup = (e: MouseEvent) => { + e.stopPropagation(); this.dispatchEvent( new CustomEvent('row-click', { detail: { @@ -1367,6 +1399,7 @@ export class LitTable extends HTMLElement { composed: true, }) ); + e.stopPropagation(); }; } @@ -1425,10 +1458,20 @@ export class LitTable extends HTMLElement { } else { this.dispatchRowClickEvent(rowObject, [element], e); } + e.stopPropagation(); }; element.onmouseenter = () => { this.dispatchRowHoverEvent(rowObject, [element]); + if ((element as any).data.isSelected) return; + let indexOf = this.currentRecycleList.indexOf(element as HTMLDivElement); + this.currentTreeDivList.forEach((row) => { + row.classList.remove('mouse-in'); + }); + if (indexOf >= 0 && indexOf < this.currentTreeDivList.length) { + this.setMouseIn(true, [this.currentTreeDivList[indexOf]]); + } }; + (element as any).data = rowObject.data; if (rowObject.data.isSelected !== undefined) { this.setSelectedRow(rowObject.data.isSelected, [element]); @@ -1483,6 +1526,7 @@ export class LitTable extends HTMLElement { } firstElement.onmouseup = (e: MouseEvent) => { this.dispatchRowClickEvent(rowObject, [firstElement, element], e); + e.stopPropagation(); }; firstElement.style.transform = `translateY(${rowObject.top - this.tableElement!.scrollTop}px)`; if (rowObject.data.isSelected !== undefined) { @@ -1496,14 +1540,16 @@ export class LitTable extends HTMLElement { setSelectedRow(isSelected: boolean, rows: any[]): void { if (isSelected) { rows.forEach((row) => { - if (row.classList.contains('mouse-in')) { - row.classList.remove('mouse-in'); + if (row.classList) { + if (row.classList.contains('mouse-in')) { + row.classList.remove('mouse-in'); + } + row.classList.add('mouse-select'); } - row.classList.add('mouse-select'); }); } else { rows.forEach((row) => { - row.classList.remove('mouse-select'); + row.classList && row.classList.remove('mouse-select'); }); } } @@ -1703,6 +1749,7 @@ export class LitTable extends HTMLElement { composed: true, }) ); + event.stopPropagation(); } dispatchRowHoverEvent(rowObject: any, elements: any[]): void { diff --git a/ide/src/base-ui/tabs/lit-tabs.html.ts b/ide/src/base-ui/tabs/lit-tabs.html.ts index dc81b65c..8165147c 100644 --- a/ide/src/base-ui/tabs/lit-tabs.html.ts +++ b/ide/src/base-ui/tabs/lit-tabs.html.ts @@ -403,6 +403,7 @@ export const LitTabsHtml = `
+
diff --git a/ide/src/base-ui/utils/Template.ts b/ide/src/base-ui/utils/Template.ts index 7066052d..dbfd161e 100644 --- a/ide/src/base-ui/utils/Template.ts +++ b/ide/src/base-ui/utils/Template.ts @@ -102,3 +102,11 @@ function escape2Html(str: string) { return arrEntities[t]; }); } + +export function replacePlaceholders(str: string, ...args: string[]): string { + return str.replace(/\{(\d+)\}/g, (match, placeholderIndex) => { + const argIndex = parseInt(placeholderIndex, 10); + const replacement = args[argIndex - 1]; + return replacement || match; + }); +} diff --git a/ide/src/doc/md/des_tables.md b/ide/src/doc/md/des_tables.md index 747e4980..40dff9d4 100644 --- a/ide/src/doc/md/des_tables.md +++ b/ide/src/doc/md/des_tables.md @@ -270,7 +270,7 @@ log 表记录日志信息。可以根据 seq 字段的连续性,来判断是 frame_slice: 记录 RS(RenderService)和应用的帧渲染。 gpu_slice: 记录 RS 的帧对应的 gpu 渲染时长。 -frame_maps:记录应用到 RS 的帧的映射关系。 +frame_maps: 记录应用到 RS 的帧的映射关系。 ![GitHub Logo](../../figures/traceStreamer/frames.jpg) ### 查询示例 @@ -290,10 +290,10 @@ js_heap_files:记录 js 内存数据的文件名和文件索引 ![1683163158954](image/des_tables/js_heap_files.png) -js_heap_nodes:记录 js 内存类对象数据 -js_heap_edges:记录 js 内存类对象的成员数据 -js_heap_trace_node:记录 timeline 的调用栈信息 -js_heap_sample:记录 timeline 的时间轴信息 +js_heap_nodes: 记录 js 内存类对象数据 +js_heap_edges: 记录 js 内存类对象的成员数据 +js_heap_trace_node: 记录 timeline 的调用栈信息 +js_heap_sample: 记录 timeline 的时间轴信息 ![1683163373206](image/des_tables/js_heap_nodes.png) ## TraceStreamer 输出数据库表格详细介绍 @@ -765,13 +765,13 @@ js_heap_sample:记录 timeline 的时间轴信息 #### 相关字段描述 -- pid:目标进程 ID。 -- type:JS 数据类型,取值与枚举 HeapType 对应,0 表示 JS 内存数据为 snapshot 类型,1 表示 JS 内存数据为 timeline 类型,-1 表示没有 JS 内存数据。 -- interval:当 type=0 时生效,单位是秒,表示一次 snapshot 事件和下一次 snapshot 事件之间的间隔。 -- capture_numeric_value:当 type=0 时生效,表示是否同时抓取 numeric。 -- track_allocation:当 type=1 时生效,表示是否抓取 allocations。 -- enable_cpu_profiler:表示是否存在 cpuprofiler 的数据。 -- cpu_profiler_interval:表示 cpuprofiler 数据的采集间隔。 +- pid: 目标进程 ID。 +- type: JS 数据类型,取值与枚举 HeapType 对应,0 表示 JS 内存数据为 snapshot 类型,1 表示 JS 内存数据为 timeline 类型,-1 表示没有 JS 内存数据。 +- interval: 当 type=0 时生效,单位是秒,表示一次 snapshot 事件和下一次 snapshot 事件之间的间隔。 +- capture_numeric_value: 当 type=0 时生效,表示是否同时抓取 numeric。 +- track_allocation: 当 type=1 时生效,表示是否抓取 allocations。 +- enable_cpu_profiler: 表示是否存在 cpuprofiler 的数据。 +- cpu_profiler_interval: 表示 cpuprofiler 数据的采集间隔。 ### js_cpu_profiler_node 表 @@ -796,14 +796,14 @@ js_heap_sample:记录 timeline 的时间轴信息 #### 相关字段描述 - function_id: 函数的 ID 号。 -- function_index:函数名称在 data_dict 中的索引号。 -- script_id:关联到的类对象所在文件的绝对路径 ID。 -- url_index:关联到的类对象所在文件的绝对路径名称在 data_dict 中的索引号。 -- line_number:类对象所在文件的行号。 -- column_number:类对象所在文件的列号。 -- hit_count:采样次数。 -- children:子节点的 id 号。 -- parent_id:父节点的 id 号。 +- function_index: 函数名称在 data_dict 中的索引号。 +- script_id: 关联到的类对象所在文件的绝对路径 ID。 +- url_index: 关联到的类对象所在文件的绝对路径名称在 data_dict 中的索引号。 +- line_number: 类对象所在文件的行号。 +- column_number: 类对象所在文件的列号。 +- hit_count: 采样次数。 +- children: 子节点的 id 号。 +- parent_id: 父节点的 id 号。 ### js_cpu_profiler_sample 表 @@ -824,10 +824,10 @@ js_heap_sample:记录 timeline 的时间轴信息 #### 相关字段描述 - id: ts 内部 ID 号。 -- function_id:函数的 ID 号。 -- start_time:数据上报的起始时间。 -- end_time:数据上报的终止时间。 -- dur:数据上报的间隔时间。 +- function_id: 函数的 ID 号。 +- start_time: 数据上报的起始时间。 +- end_time: 数据上报的终止时间。 +- dur: 数据上报的间隔时间。 ### js_heap_edges 表 diff --git a/ide/src/doc/md/quickstart_ability_monitor.md b/ide/src/doc/md/quickstart_ability_monitor.md index e0325ef1..4a448988 100644 --- a/ide/src/doc/md/quickstart_ability_monitor.md +++ b/ide/src/doc/md/quickstart_ability_monitor.md @@ -15,7 +15,7 @@ ![GitHub Logo](../../figures/AbilityMonitor/abilitysetting.jpg) 点击 Trace command,就会根据上面的配置生成抓取命令,点击复制按钮,会将命令行复制。 ![GitHub Logo](../../figures/AbilityMonitor/abilitycommand.jpg) -输入 hdc_shell,进入设备,执行命令。 +输入 hdc shell,进入设备,执行命令。 ![GitHub Logo](../../figures/AbilityMonitor/abilityexcutecommand.jpg) 进入指定目录,cd /data/local/tmp 进入到目录,会看到生成的 trace 文件。 ![GitHub Logo](../../figures/AbilityMonitor/abilityhtrace.jpg) @@ -43,6 +43,10 @@ Ability Monitor 展开就可以看到泳道图,包括 CPU,内存,磁盘 IO - Network Bytes Out/Sec: 每秒发送的网络数据字节数。 - Network Packets In/Sec:每秒接收的网络数据包数。 - Network Packets Out/Sec: 每秒发送的网络数据包数。 +- Purgeable Total: 可清除总量。 +- Purgeable Pin:可清除编码。 +- DMA:直接内存存取。 +- Skia Gpu Memory:Skia显存。 ### Ability Monitor 泳道图的框选功能 diff --git a/ide/src/doc/md/quickstart_arkts.md b/ide/src/doc/md/quickstart_arkts.md index c5c40238..e47cb29c 100644 --- a/ide/src/doc/md/quickstart_arkts.md +++ b/ide/src/doc/md/quickstart_arkts.md @@ -20,7 +20,7 @@ Cpuprofiler 模板帮助 ArkTs 开发和测试分析虚拟机层执行开销大 ![GitHub Logo](../../figures/arkts/cpuprofilertip.jpg) - Name : 函数名。 -- Self Time: 函数自身执行时间(不包含其调用者)。 +- Self Time : 函数自身执行时间(不包含其调用者)。 - Total Time : 函数自身及调用者的调用时间总和。 - Url : 函数所在的文件名称。 @@ -38,13 +38,13 @@ Js Profiler Statistics 的 Tab 页显示数据的维度信息,以饼图和 Tab ![GitHub Logo](../../figures/arkts/cpuprofilerselectc.jpg) ![GitHub Logo](../../figures/arkts/cpuprofilerdragc.jpg) - Symbol : 函数名。 -- Self Time: 函数自身执行时间(不包含其调用者)。 +- Self Time : 函数自身执行时间(不包含其调用者)。 - Total Time : 函数自身及调用者的调用时间总和。 Js Profiler BottomUp 的 Tab 页把 name,url,depth,parent 相同的函数合并,构建成一个 bottom up 的树结构,以树形表格的形式显示,只不过作为根节点的是被调用者,表格中显示函数被调用关系,如下图: ![GitHub Logo](../../figures/arkts/cpuprofilerselectb.jpg) ![GitHub Logo](../../figures/arkts/cpuprofilerdragb.jpg) - Symbol : 函数名。 -- Self Time: 函数自身执行时间(不包含其调用者)。 +- Self Time : 函数自身执行时间(不包含其调用者)。 - Total Time : 函数自身及调用者的调用时间总和。 ### Cpuprofiler 的 Heaviest Stack 功能 diff --git a/ide/src/doc/md/quickstart_bio.md b/ide/src/doc/md/quickstart_bio.md index 4862bc40..ac305257 100644 --- a/ide/src/doc/md/quickstart_bio.md +++ b/ide/src/doc/md/quickstart_bio.md @@ -45,7 +45,7 @@ Disk I/O Tier Statistics 的 Tab 页如图: - Min Total Latency:最小延迟时间。 - Avg Total Latency:平均延迟时间。 - Max Total Latency:最大延迟时间。 - Disk I/O Latency Calltree 的 Tab 页如图: + Disk I/O Latency CallTree 的 Tab 页如图: ![GitHub Logo](../../figures/Bio/BioCalltree.jpg) - Call Stack:为经过符号解析后的Callstack,并且给出动态链接库或者进程名的信息。 - Local:为该调用方法自身占用的CPU时间。 @@ -66,7 +66,7 @@ Disk I/O Tier Statistics 的 Tab 页如图: ### Bio 支持多种 Options 展示风格 -点击 Disk I/O Latency Calltree 的 Tab 页底部的 Options,会有两个 CheckBox 复选框。 +点击 Disk I/O Latency CallTree 的 Tab 页底部的 Options,会有两个 CheckBox 复选框。 ![GitHub Logo](../../figures/Bio/BioOptions.jpg) - Invert:反向输出调用树。 @@ -74,7 +74,7 @@ Disk I/O Tier Statistics 的 Tab 页如图: ### Bio 支持过滤调用栈调用次数的展示风格 -点击 Disk I/O Latency Calltree 的 Tab 页底部的 Sample Counter Filter,可以填上区间值。过滤出符合该区间值调用次数的调用栈信息。 +点击 Disk I/O Latency CallTree 的 Tab 页底部的 Sample Count Filter,可以填上区间值。过滤出符合该区间值调用次数的调用栈信息。 ![GitHub Logo](../../figures/Bio/Biocounter.jpg) ### Bio 功能的调用栈 Group 展示-数据分析支持剪裁功能 @@ -103,7 +103,7 @@ Disk I/O Tier Statistics 的 Tab 页如图: ### Bio 的火焰图功能 -点击 Disk I/O Latency Calltree 左下角的柱状图的图标,会切换到火焰图页面。 +点击 Disk I/O Latency CallTree 左下角的柱状图的图标,会切换到火焰图页面。 ![GitHub Logo](../../figures/Bio/Bioflame.jpg) 进入到火焰图页面,火焰图的展示跟 Callinfo 的 tab 页的调用栈显示一致,鼠标放到色块上,悬浮框可以显示调用栈名称和 Duration 时长。 ![GitHub Logo](../../figures/Bio/Bioflameshow.jpg) diff --git a/ide/src/doc/md/quickstart_device_record.md b/ide/src/doc/md/quickstart_device_record.md index f072110f..9a1f750a 100644 --- a/ide/src/doc/md/quickstart_device_record.md +++ b/ide/src/doc/md/quickstart_device_record.md @@ -7,15 +7,15 @@ ![GitHub Logo](../../figures/hiprofilercmd/systraceconfig.jpg) 说明: -- Record setting:设置 trace 的抓取模式,buffer size 大小,抓取时长。 -- Trace command:生成的抓取命令行。 -- Probes config:trace 的抓取参数配置。 -- Native Memory:NativeMemory 数据的抓取参数配置。 -- Hiperf:Hiperf 数据的抓取参数配置。 -- eBPF Config:ebpf 数据的抓取参数配置。 -- VM Tracker:smaps 数据的抓取参数配置。 -- HiSystemEvent:HiSystemEvent 数据抓取参数配置。 -- SDK Config:SDK 数据抓取参数配置。 +- Record setting: 设置 trace 的抓取模式,buffer size 大小,抓取时长。 +- Trace command: 生成的抓取命令行。 +- Probes config: trace 的抓取参数配置。 +- Native Memory: NativeMemory 数据的抓取参数配置。 +- Hiperf: Hiperf 数据的抓取参数配置。 +- eBPF Config: ebpf 数据的抓取参数配置。 +- VM Tracker: Smaps数据的抓取参数配置。 +- HiSystemEvent: HiSystemEvent 数据抓取参数配置。 +- SDK Config: SDK 数据抓取参数配置。 ## 命令行的生成和 trace 文件的抓取 @@ -27,12 +27,12 @@ ![GitHub Logo](../../figures/hiprofilercmd/command.jpg) 命令参数说明: -- -o:文件的输入路径和名称。 -- -t:抓取的时长。 -- buffer pages:buffer size 大小。 -- sample_duration:数据采集的时间。 -- sample_interval:主动获取插件数据的间隔时间(ms,只针对轮询插件,例如 memory 插件,cpu 插件,dikio 插件等,对流式插件和独立插件无效)。 -- trace_period_ms:ftrace 插件读取内核缓冲区数据的间隔时间(ms)。 +- -o: 文件的输入路径和名称。 +- -t: 抓取的时长。 +- buffer pages: buffer size 大小。 +- sample_duration: 数据采集的时间。 +- sample_interval: 主动获取插件数据的间隔时间(ms,只针对轮询插件,例如 memory 插件,cpu 插件,dikio 插件等,对流式插件和独立插件无效)。 +- trace_period_ms: ftrace 插件读取内核缓冲区数据的间隔时间(ms)。 - hitrace_time:hitrace 命令行抓取时间,与 hiprofiler_cmd 下发的-t 配置联动。 输入 hdc_std shell,进入设备,执行命令。 diff --git a/ide/src/doc/md/quickstart_filesystem.md b/ide/src/doc/md/quickstart_filesystem.md index 425d2c88..72fd4f6b 100644 --- a/ide/src/doc/md/quickstart_filesystem.md +++ b/ide/src/doc/md/quickstart_filesystem.md @@ -35,14 +35,14 @@ FileSystem 分析文件系统的信息和活动,比如读和写操作等。 ### FileSystem 泳道图展示 -FileSystem 泳道图按照读操作和写操作展示,鼠标移动都泳道图上,悬浮框会以 10ms 为周期展示读,写类型系统调用的次数。 +FileSystem 泳道图按照读操作和写操作展示,鼠标移动到泳道图上,悬浮框会以 10ms 为周期展示读,写类型系统调用的次数。 ![GitHub Logo](../../figures/FileSystem/FileSystemchart.jpg) 按住 w 键放大界面,悬浮框会显示当前时刻的文件读写次数。 ![GitHub Logo](../../figures/FileSystem/FileSystemcount.jpg) ### FileSystem 泳道图的框选功能 -可以对读写操作泳道图进行框选,框选后在最下方的弹出层中会展示框选数据的统计表格,总共有五个 tab 页。 +可以对读写操作泳道图进行框选,框选后展示框选数据的统计表格,总共有六个 tab 页。 FileSystem statistics 的 Tab 页如图: ![GitHub Logo](../../figures/FileSystem/FileSystemstatistics.jpg) @@ -55,7 +55,7 @@ FileSystem statistics 的 Tab 页如图: - Min Duration:最小时长。 - Avg Duration: 平均时长。 - Max Duration:最大时长。 - FileSystem Calltree 的 Tab 页如图: + FileSystem CallTree 的 Tab 页如图: ![GitHub Logo](../../figures/FileSystem/FileSystemCalltree.jpg) - Call Stack:为经过符号解析后的Callstack,并且给出动态链接库或者进程名的信息。 - Local:为该调用方法自身占用的CPU时间。 @@ -66,6 +66,9 @@ FileSystem statistics 的 Tab 页如图: - Duration:时长。 - Process:进程名。 - Thread:线程名。 +- Type:操作类型。 +- File Descriptor:fd。 +- File Path:文件路径。 - First Argument:系统调用的第一个参数。 - Second Argument:系统调用的第二个参数。 - Third Argument:系统调用的第三个参数。 @@ -80,6 +83,7 @@ FileSystem statistics 的 Tab 页如图: - Process:进程名。 - Type:操作类型。 - File Descriptor:fd。 +- Path:文件路径。 - Backtrace:调用栈顶部函数,并显示调用栈深度。 File Descriptor Time Slice 的 Tab 页如图: ![GitHub Logo](../../figures/FileSystem/FileSystemtimeslice.jpg) @@ -87,19 +91,22 @@ FileSystem statistics 的 Tab 页如图: - Open Duration:打开的时长。 - Process:进程名。 - File Descriptor:fd。 +- Path:文件路径。 - Backtrace:调用栈顶部函数,并显示调用栈深度。 ### FileSystem 支持多种 Options 展示风格 -点击 FileSystem Calltree 的 Tab 页底部的 Options,会有两个 CheckBox 复选框。 +点击 FileSystem CallTree 的 Tab 页底部的 Options,会有四个 CheckBox 复选框。 ![GitHub Logo](../../figures/FileSystem/FileSystemOptions.jpg) - Invert:反向输出调用树。 - Hide System so:隐藏系统库文件。 +- Hide Event:隐藏事件。 +- Hide Thread:隐藏线程。 ### FileSystem 支持过滤调用栈调用次数的展示风格 -点击 FileSystem Calltree 的 Tab 页底部的 Sample Counter Filter,可以填上区间值。过滤出符合该区间值调用次数的调用栈信息。 +点击 FileSystem CallTree 的 Tab 页底部的 Sample Count Filter,可以填上区间值。过滤出符合该区间值调用次数的调用栈信息。 ![GitHub Logo](../../figures/FileSystem/FileSystemsamplecounter.jpg) ### FileSystem 功能的调用栈 Group 展示-数据分析支持剪裁功能 @@ -128,7 +135,7 @@ FileSystem statistics 的 Tab 页如图: ### FileSystem 的火焰图功能 -点击 FileSystem Calltre 左下角的柱状图的图标,会切换到火焰图页面。 +点击 FileSystem CallTree 左下角的柱状图的图标,会切换到火焰图页面。 ![GitHub Logo](../../figures/FileSystem/FileSystemflame.jpg) 进入到火焰图页面,火焰图的展示跟 Callinfo 的 tab 页的调用栈显示一致,鼠标放到色块上,悬浮框可以显示调用栈名称和 Duration 时长。 ![GitHub Logo](../../figures/FileSystem/FileSystemflameshow.jpg) diff --git a/ide/src/doc/md/quickstart_hiperf.md b/ide/src/doc/md/quickstart_hiperf.md index e4da5784..224570c6 100644 --- a/ide/src/doc/md/quickstart_hiperf.md +++ b/ide/src/doc/md/quickstart_hiperf.md @@ -10,7 +10,7 @@ HiPerf 工具是对系统性能数据进行采样记录,并将采样数据保 配置项说明: - Start Hiperf Sampling:配置项的总开关。 -- Process:离线模式下配置的是整个系统的。 +- Process:离线模式下配置的是整个系统的进程。 - Frequency:配置抓取的频率。 - Call Stack:配置抓取的堆栈类型。 - Advance Options:更多的抓取配置项。 @@ -18,7 +18,7 @@ HiPerf 工具是对系统性能数据进行采样记录,并将采样数据保 ![GitHub Logo](../../figures/perf/perfset.jpg) 点击 Trace command,就会根据上面的配置生成抓取命令,点击复制按钮,会将命令行复制。 ![GitHub Logo](../../figures/perf/perfcommand.jpg) - 输入 hdc_shell,进入设备,执行命令。 + 输入 hdc shell,进入设备,执行命令。 ![GitHub Logo](../../figures/perf/perfexcutecommand.jpg) 执行完成后,进入指定目录查看,在/data/local/tmp 下就会生成 trace 文件。 ![GitHub Logo](../../figures/perf/perffile.jpg) @@ -45,13 +45,14 @@ Perf 泳道图上浅色表示无效调用栈的采样点,抓取时由于设备 ### HiPerf 泳道图的框选功能 -可以对 CPU 使用量区,线程和进程区数据进行框选,框选后在最下方的弹出层中会展示框选数据的统计表格,总共有两个 tab 页。 +可以对 CPU 使用量的线程和进程区数据进行框选,框选后在最下方的弹出层中会展示框选数据的统计表格,总共有四个 tab 页。 Perf Profile 的 Tab 页如图: ![GitHub Logo](../../figures/perf/PerfProfile.jpg) - Call Stack:为经过符号解析后的Callstack,并且给出动态链接库或者进程名的信息。 - Local:为该调用方法自身占用的CPU时间。 -- Weight:调用方法的执行次数和占比。 +- Sample Count:采样数量。 +- Event Count:事件数量。 Sample List 的 Tab 页如图: ![GitHub Logo](../../figures/perf/Samplelist.jpg) - Sample Time:采样的时间戳信息。 @@ -63,15 +64,17 @@ Perf Profile 的 Tab 页如图: ### HiPerf 支持多种 Options 展示风格 -点击 Perf Profile 的 Tab 页底部的 Options,会有两个 CheckBox 复选框。 +点击 Perf Profile 的 Tab 页底部的 Options,会有四个 CheckBox 复选框。 ![GitHub Logo](../../figures/perf/Options.jpg) - Invert:反向输出调用树。 - Hide System so:隐藏系统库文件。 +- Hide Thread:隐藏线程。 +- Hide Thread State:隐藏线程状态。 ### HiPerf 支持过滤调用栈调用次数的展示风格 -点击 Perf Profile 的 Tab 页底部的 Sample Counter Filter,可以填上区间值。过滤出符合该区间值调用次数的调用栈信息。 +点击 Perf Profile 的 Tab 页底部的 Sample Count Filter,可以填上区间值。过滤出符合该区间值调用次数的调用栈信息。 ![GitHub Logo](../../figures/perf/samplecounter.jpg) ### HiPerf 功能的调用栈 Group 展示-数据分析支持剪裁功能 diff --git a/ide/src/doc/md/quickstart_hisystemevent.md b/ide/src/doc/md/quickstart_hisystemevent.md index 8e8d80e9..cd3269ea 100644 --- a/ide/src/doc/md/quickstart_hisystemevent.md +++ b/ide/src/doc/md/quickstart_hisystemevent.md @@ -27,7 +27,7 @@ HiSystemEvent 应用功耗模块主要是展示应用的各个子类别功耗占 - Anomaly Event泳道: 显示系统异常和应用异常的ToolTip。 - System Event泳道: 以条状图显示,红色代表后台任务(WORKSCHEDULER),黄色代表应用锁(POWER),蓝色代表GPS定位(LOCATION)。 -- Power泳道:应用各个子类的功耗柱状图、折现图以及应用各个子类绘制的图例,鼠标的悬浮可以显示出各个子类功耗的具体值。 +- Power泳道:应用各个子类的功耗柱状图、折线图以及应用各个子类绘制的图例,鼠标的悬浮可以显示出各个子类功耗的具体值。 - Brightness Nit泳道:鼠标悬浮可以显示屏幕亮度值。 - Wifi Event Received泳道:鼠标悬浮可以显示WiFi信号强度值。 - Audio Stream Change泳道:鼠标悬浮可以显示Audio状态(AUDIO_STREAM_CHANGE事件)。 diff --git a/ide/src/doc/md/quickstart_native_memory.md b/ide/src/doc/md/quickstart_native_memory.md index d6474b1b..ac216a72 100644 --- a/ide/src/doc/md/quickstart_native_memory.md +++ b/ide/src/doc/md/quickstart_native_memory.md @@ -17,7 +17,7 @@ Native Memory 是查看内存的分配和释放等情况。 - Use Record Accurately:不过滤数据,上报全量的。 - Use Offline Symbolization:离线符号化。 - Use Record Statistics:统计数据上报时间间隔设置。 -- Use Startup Mode :抓取应用启动阶段的内存(默认是关闭,需要抓取应用启阶段内存可开启)。 +- Use Startup Mode: 抓取应用启动阶段的内存(默认是关闭,需要抓取应用启阶段内存可开启)。 再点击 Record setting,在 output file path 输入文件名 hiprofiler_data_nativememory.htrace,拖动滚动条设置 buffer size 大小是 64M,抓取时长是 50s。 ![GitHub Logo](../../figures/NativeMemory/nativememoryset.jpg) @@ -141,9 +141,10 @@ Call Info 的 Tab 页,主要显示了调用树详细类型。 ### 搜索框支持表达式输入 -调用栈默认显示火焰图,新增搜索框表达式输入。表达式作用范围为 nativehook 统计与非统计模式。其中处理的均为 Responsible Library 与 Responsible Caller,其中 Responsible Library,Responsible Caller 表示从下往上非 libc++ musl 的第一条调用栈的 lib 跟 symbol,如下图所示,由于最后一条 [ operator new(unsigned long) ] libc++.so 为 libc++.so 的函数,固跳过,所以该条调用栈的 Responsible Library 为 libhilog.so,Responsible Caller 为 OHOS::HiviewDFX::GetDomainLevel(unsigned int) 。 +调用栈默认会显示火焰图,新增搜索框表达式输入。表达式作用范围为 nativehook 的统计与非统计模式。其中处理的为 Responsible Library 与 Responsible Caller,其中 Responsible Library 和Responsible Caller 表示从下往上非 libc++ musl 的第一条调用栈的 lib 跟 symbol,如下图所示,由于最后一条 [ operator new(unsigned long) ] libc++.so 为 libc++.so 的函数,故跳过,所以该条调用栈的 Responsible Library 为 libhilog.so,Responsible Caller 为 OHOS::HiviewDFX::GetDomainLevel(unsigned int) 。 ![GitHub Logo](../../figures/NativeMemory/framecaller.jpg) -表达式说明:在 InputFilter 输入框可以进行搜索过滤和表达式过滤,其中表达式必须以@开头,英文括号包起所需要过滤的内容,每个括号必须包括 (Responsible Library,Responsible Caller)匹配全量以\*表示,否则认为该输入为搜索过滤。 + +表达式说明: 在 InputFilter 输入框可以进行搜索过滤和表达式过滤,其中表达式必须以@开头,英文括号包起所需要过滤的内容,每个括号必须包括 (Responsible Library,Responsible Caller)匹配全量以\*表示,否则认为该输入为搜索过滤。 | 表达式 | 含义 | | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/ide/src/doc/md/quickstart_page_fault.md b/ide/src/doc/md/quickstart_page_fault.md index b3968ce9..c5b09570 100644 --- a/ide/src/doc/md/quickstart_page_fault.md +++ b/ide/src/doc/md/quickstart_page_fault.md @@ -50,7 +50,7 @@ Page Fault Statistics 的 Tab 页如图: - Max Duration:最大时长。 点击下方的 Statistics by Thread,可以切换到按照 Thread 为基点显示数据。 ![GitHub Logo](../../figures/EBPF/ebpf_bythread.jpg) - Page Fault Calltree 的 Tab 页如图: + Page Fault CallTree 的 Tab 页如图: ![GitHub Logo](../../figures/EBPF/VMCalltree.jpg) - Call Stack:为经过符号解析后的Callstack,并且给出动态链接库或者进程名的信息。 - Local:为该调用方法自身占用的CPU时间。 @@ -66,7 +66,7 @@ Page Fault Statistics 的 Tab 页如图: ### 页内存支持多种 Options 展示风格 -点击 Page Fault Calltree 的 Tab 页底部的 Options,会有两个 CheckBox 复选框。 +点击 Page Fault CallTree 的 Tab 页底部的 Options,会有两个 CheckBox 复选框。 ![GitHub Logo](../../figures/EBPF/vmOptions.jpg) - Invert:反向输出调用树。 @@ -74,7 +74,7 @@ Page Fault Statistics 的 Tab 页如图: ### 页内存支持过滤调用栈调用次数的展示风格 -点击 Page Fault Calltree 的 Tab 页底部的 Sample Counter Filter,可以填上区间值。过滤出符合该区间值调用次数的调用栈信息。 +点击 Page Fault CallTree 的 Tab 页底部的 Sample Count Filter,可以填上区间值。过滤出符合该区间值调用次数的调用栈信息。 ![GitHub Logo](../../figures/EBPF/vmcounter.jpg) ### 页内存功能的调用栈 Group 展示-数据分析支持剪裁功能 @@ -97,12 +97,12 @@ Page Fault Statistics 的 Tab 页如图: ### 页内存的事件类型的过滤 -通过选择可以过滤是 File Backed In 类型,还是 Copy On Write 类型事件。 +通过选择类型事件进行过滤。 ![GitHub Logo](../../figures/EBPF/VMfilter.jpg) ### 页内存的火焰图功能 -点击 Page Fault Calltree 左下角的柱状图的图标,会切换到火焰图页面。 +点击 Page Fault CallTree 左下角的柱状图的图标,会切换到火焰图页面。 ![GitHub Logo](../../figures/EBPF/vmflame.jpg) 进入到火焰图页面,火焰图的展示跟 Callinfo 的 tab 页的调用栈显示一致,鼠标放到色块上,悬浮框可以显示调用栈名称和 Duration 时长。 ![GitHub Logo](../../figures/EBPF/vmflameshow.jpg) diff --git a/ide/src/doc/md/quickstart_parsing_ability.md b/ide/src/doc/md/quickstart_parsing_ability.md index b3bb8584..e39a320a 100644 --- a/ide/src/doc/md/quickstart_parsing_ability.md +++ b/ide/src/doc/md/quickstart_parsing_ability.md @@ -28,7 +28,7 @@ Trace 解析能力增强主要是提高 Trace 的解析能力。 ##### 配置完成后, 查看【用户配置路径】是否是配置的路径 - edge浏览器: edge://version/ + edge浏览器: edge://version/ chrome浏览器: chrome://version/ #### 超大 trace 抓取配置说明 diff --git a/ide/src/doc/md/quickstart_sql_metrics.md b/ide/src/doc/md/quickstart_sql_metrics.md index f06ba59c..dcfe181f 100644 --- a/ide/src/doc/md/quickstart_sql_metrics.md +++ b/ide/src/doc/md/quickstart_sql_metrics.md @@ -9,7 +9,7 @@ Sql 功能是方便使用者查询 sql 语句查看相关业务,Metrics 是更 ## Metrics 功能介绍 -Metrics 是更高级别的查询接口,无需手动键入任何 SQL 语句,只需要选择定制好的查询接口,就能获得想要跟踪的结果。 +Metrics 是更高级别的查询接口,无需手动输入任何 SQL 语句,只需要选择定制好的查询接口,就能获得想要跟踪的结果。 ### Metrics 查询接口展示 diff --git a/ide/src/doc/md/quickstart_systemtrace.md b/ide/src/doc/md/quickstart_systemtrace.md index 4802cbbd..b4f52d8d 100644 --- a/ide/src/doc/md/quickstart_systemtrace.md +++ b/ide/src/doc/md/quickstart_systemtrace.md @@ -12,7 +12,7 @@ - Open trace file:导入离线 trace 文件入口。 - Open long trace file:导入大文件入口。 - Record new trace:抓取新的 trace 文件入口。 -- Record template:抓取指定模块的 trace 入口。 +- Record template:抓取指定模块的 trace 文件入口。 ## 导入 trace 文件后显示页面 @@ -128,7 +128,7 @@ Thread States、Thread Switches 的 2 个 Tab 页,点击移动到某一行, ### Tab 页信息和泳道图可跳转(点击和框选场景,框选类似搜索) -泳道图高亮场景:框选 Cpu Frequency 或者 Cpu State 泳道图后,弹出 Cpu Frequency 或 Cpu State Tab 页,在点击 Tab 页表格的行时,框选范围泳道图的当前行的 Value 值一样的部分上方会出现一条以圆点开头颜色比趋势图颜色同色但稍深的粗线条,如下图: +泳道图高亮场景:框选 Cpu Frequency 或者 Cpu State 泳道图后,弹出 Cpu Frequency 或 Cpu State Tab 页,点击 Tab 页表格中行某一行数据时,会在框选范围泳道内出现一个以圆形开头的图标,表示当前所点击的数据,如下图: ![GitHub Logo](../../figures/Web/Tabskill.jpg) 搜索场景:框选函数调用栈的泳道图,弹出 Slices Tab 页,点击表格行,会跳转到框选范围内的第一条调用栈的位置,点击下图 Slices Tab 页的 Background concurrent copying GC 调用栈。 ![GitHub Logo](../../figures/Web/Tabskillcalltack.jpg) diff --git a/ide/src/doc/md/quickstart_web_record.md b/ide/src/doc/md/quickstart_web_record.md index efcf14b6..a6f0e3db 100644 --- a/ide/src/doc/md/quickstart_web_record.md +++ b/ide/src/doc/md/quickstart_web_record.md @@ -5,10 +5,11 @@ ## 界面配置说明 ![GitHub Logo](../../figures/hdc/hdc.jpg) + 说明: -- Record:trace 抓取按钮。 -- Add HDC Device:连接设备。 +- Record: trace 抓取按钮。 +- Add HDC Device: 连接设备。 ## trace 文件的在线抓取 @@ -18,13 +19,13 @@ ![GitHub Logo](../../figures/hdc/Schedulingdetails.jpg) 抓取项说明: -- Scheduling details:线程切换事件,暂停恢复方法,线程唤醒事件,进程退出和销毁处理,新建线程处理方法,线程重命名处理方法。 -- CPU Frequency and idle states:CPU 频率信息和 CPU 空闲状态。 -- Advanced ftrace config:线程切换事件,暂停恢复方法,线程唤醒事件,进程退出和销毁处理,新建线程处理方法,线程重命名处理方法,IRQ 事件,时钟频率处理方法,Binder 事件,线程调用堆栈开始和结束的处理。 -- AbilityMonitor:进程的 CPU,内存,磁盘,网络使用情况。 -- Kernel meminfo:内核内存。 -- Virtual memory stats:系统虚拟内存。 -- Hitrace categories:Bytrace 的抓取项,各解释项说明如下图: +- Scheduling details: 线程切换事件,暂停恢复方法,线程唤醒事件,进程退出和销毁处理,新建线程处理方法,线程重命名处理方法。 +- CPU Frequency and idle states: CPU 频率信息和 CPU 空闲状态。 +- Advanced ftrace config: 线程切换事件,暂停恢复方法,线程唤醒事件,进程退出和销毁处理,新建线程处理方法,线程重命名处理方法,IRQ 事件,时钟频率处理方法,Binder 事件,线程调用堆栈开始和结束的处理。 +- AbilityMonitor: 进程的 CPU,内存,磁盘,网络使用情况。 +- Kernel meminfo: 内核内存。 +- Virtual memory stats: 系统虚拟内存。 +- Hitrace categories: Bytrace 的抓取项,各解释项说明如下图: ![GitHub Logo](../../figures/hdc/bytacedescription.jpg) 再点击 Record setting,在 output file path 输入文件名 hiprofiler_data_example.htrace,拖动滚动条设置 buffer size 大小是 64M,抓取时长是 50s。 diff --git a/ide/src/doc/quickstart_bio.html b/ide/src/doc/quickstart_bio.html index b1fa979c..6ed54a19 100644 --- a/ide/src/doc/quickstart_bio.html +++ b/ide/src/doc/quickstart_bio.html @@ -908,7 +908,7 @@ Max Total Latency:最大延迟时间。

- Disk I/O Latency Calltree的Tab页如图:
+ Disk I/O Latency CallTree的Tab页如图:
GitHub Logo