diff --git a/README_zh.md b/README_zh.md index 38e2cebaeb239a565687682defad1e7cb7f6742b..934b9ab7ee671aff2cd28873ef46608cd232ae26 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,27 +1,24 @@ # SmartPerf -- [简介](#简介) -- [目录](#目录) -- [约束](#约束) -- [相关文档](#相关文档) - ## 简介 -- **SmartPerf** 是一款基于OpenHarmony系统开发的性能功耗测试分析工具,支持两个组成部分: SP-Device端和SP-Host端。 -- **SP-Device端:** 是一款初级的,粗粒度的数据采集分析的性能功耗测试工具。支持FPS、功耗、热、Soc信息的实时采集、实时展示、数据报告生成。 -- **SP-Host端:** 是一款深入挖掘数据、细粒度的展示数据的性能功耗测试工具。支持CPU调度、频点、进程线程时间片、堆内存、FPS数据采集和展示。支持在泳道图中展示非实时的采集数据,支持GUI操作数据分析。 +- **SmartPerf** 是基于OpenHarmony系统开发的性能、功耗测试工具链,支持两个组成部分:设备端的Device工具和PC端的Host工具。 +- **Device工具:** 是一款初级的、粗粒度的数据采集性能、功耗测试工具,支持帧率、功耗、热、Soc信息的实时采集、实时展示、数据报告生成。 +- **Host工具:** 是一款深入挖掘数据、细粒度的展示数据的性能、功耗测试工具,支持CPU调度、频点、进程线程时间片、堆内存、FPS数据采集和展示,支持在泳道图中展示非实时的采集数据,支持GUI操作数据分析。 其主要的结构如下图所示: -![系统架构图](http://image.huawei.com/tiny-lts/v1/images/cc51c24a361d47dd1d10b23f089a0faa_877x491.png) +![系统架构图](figures/SmartPerf.png) ## 目录 ``` -/developtools/smartperf +/smartperf ├── device # device端 相关代码 │   ├── device_command # device端 命令行方式采集代码 │ ├── device_ui # device端 GUI方式采集代码 +│ ├── figures # device端 相关截图 +├── figures # 相关截图 ├── host # host端 相关代码 │ ├── doc # host端 相关使用文档 │ ├── ide # host端 IDE 模块目录 @@ -53,13 +50,10 @@ host端构建约束 ## 相关文档 -- [device_command_line_collection](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/quickstart_trace_streamer.md) -- [device_ui_collection](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/quickstart_trace_streamer.md) -- [quickstart_trace_streamer](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/quickstart_trace_streamer.md) -- [quickstart_smartperf](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/quickstart_smartperf.md) -- [quickstart_hiprofiler_cmd](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/quickstart_hiprofiler_cmd.md) -- [compile_smartperf](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/compile_smartperf.md) -- [compile_trace_streamer](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/compile_trace_streamer.md) -- [des_stat](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/des_stat.md) -- [des_support_event](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/des_support_event.md) -- [des_tables](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/doc/des_tables.md) \ No newline at end of file + +- [SmartPerf Device工具使用说明](device/README_zh.md) +- [SmartPerf Device工具客户端使用说明](device/device_ui/README_zh.md) +- [SmartPerf Device工具服务端使用说明](device/device_command/README_zh.md) +- [SmartPerf Host工具的运行和使用方法](host/doc/quickstart_smartperf.md) +- [SmartPerf Host工具编译网页可运行环境](host/doc/compile_smartperf.md) +- [SmartPerf Host工具编译数据解析文件](host/doc/compile_trace_streamer.md) \ No newline at end of file diff --git a/device/README_zh.md b/device/README_zh.md index cf54a239f8f15669311c4053fc71a5c00eecd114..baa22921d482d73517089dda92b4e93d72452f4a 100644 --- a/device/README_zh.md +++ b/device/README_zh.md @@ -1,47 +1,47 @@ -# SmartPerf(Device、Daemon) +# Device ## 概述 -为支撑OpenHarmony性能测试,我们向用户提供了符合功能需求并且可靠、易用的性能测试工具。支持开发者针对应用进行相应的性能数据采集以及指标计算功能。 +为支撑OpenHarmony性能测试,我们向用户提供了符合功能需求并且可靠、易用的性能测试工具,支持开发者针对应用进行相应的性能数据采集以及指标计算功能。 ## 简介 -SmartPerf(Device、Daemon)是基于OpenHarmony系统开发的性能功耗测试工具,操作简单易用,可提供包括性能、功耗的关键KPI指标,给出具体指标的测试值,包括采集设备的FPS、CPU、GPU、Ftrace等指标数据; +Device是基于OpenHarmony系统开发的性能功耗测试工具,操作简单易用,可提供包括性能、功耗的关键KPI指标,给出具体指标的测试值,包括采集设备的帧率、soc信息等指标数据; -目前SmartPerf(Device、Daemon)工具提供了两种使用方式,分别为hap应用可视化操作方式(SmartPerf-Device)和shell命令行方式(SmartPerf-Daemon),其中SmartPerf-Device支持可视化操作、悬浮窗控制暂停,悬浮窗实时展示数据,SmartPerf-Daemon主要适用于无屏设备、性能较差的设备,对3568等设备同样支持。 +目前Device工具提供了两种使用方式,分别为Device客户端(Hap应用名称:SmartPerf)可视化的使用方式和Device服务端(bin名称:SP_daemon)shell命令行的使用方式,其中Device客户端支持悬浮窗控制采集、悬浮窗实时展示数据、图形化展示报告等功能,Device服务端支持shell中启动测试、实时打印数据、报告保存等功能。 ## 实现原理 -SmartPerf工具主要包括SmartPerf-Device、SmartPerf-Daemon两个部分,其中Device采集的FPS、RAM、Trace等指标需要通过发送消息给Daemon端去采集数据,然后接收Daemon回传的数据展示,同时Daemon端也提供了shell命令的方式单独执行采集,工具的主要功能组成如下图: +Device客戶端采集的FPS、RAM等指标需要通过发送消息给Device服务端去采集数据,然后接收Device服务端回传的数据,然后进行展示,同时Device服务端支持单独执行shell命令的方式启动采集,工具的主要功能组成如下图: ![图片说明](figures/SmartPerfStru.png) ## 约束与限制 -1.SmartPerf-Device、SmartPerf-Daemon在3.2系统版本后开始预制使用。 +1.Device客户端、Device服务端在3.2.5.1版本后开始预制使用。 -2.其中SmartPerf-Device的使用必须是具备屏幕的设备。 +2.其中Device客户端只能在具备屏幕的设备上使用。 ## 环境准备 -SmartPerf-Daemon执行需要PC连接OpenHarmony设备,如RK3568开发板等。 +Device服务端的执行需要使用PC连接OpenHarmony设备,如RK3568开发板等。 ## 执行性能测试 -**SmartPerf-Device应用可视化使用示例,详细请参考[SmartPerf-Device使用](device_ui/README_zh.md)** +**Device客户端(Hap应用名称:SmartPerf)可视化使用示例,详细请参考[Device客户端使用](device_ui/README_zh.md)** -以下SmartPerf-Device应用内截图以RK3568设备为例。 +以下Device客户端应用内截图,以RK3568设备为例。 1.应用采集配置。 -启动SmartPerf-Device进入首页,选择测试应用、测试指标项,点击”开始测试“,拉起测试应用。 +启动SmartPerf-Device进入首页,选择测试应用、测试指标项,点击“开始测试”,拉起测试应用。 ![图片说明](figures/SmartPerfConfig1.png) ![图片说明](figures/SmartPerfConfig2.png) ![图片说明](figures/SmartPerfConfig3.png) 2.悬浮窗控制采集。 -点击悬浮窗”start“开始采集,单击悬浮窗”计时器“暂停采集,再次单击继续采集双击计时器,实时展示采集数据,可拖动悬浮框更改悬浮框位置,长按”计时器“,结束采集。 +点击悬浮窗“start”开始采集,单击悬浮窗“计时器”暂停采集,再次单击继续采集,双击计时器实时展示采集数据,可拖动悬浮框更改悬浮框位置,长按“计时器”结束采集。 ![图片说明](figures/SmartPerfControl1.png) ![图片说明](figures/SmartPerfControl2.png) @@ -53,7 +53,7 @@ SmartPerf-Daemon执行需要PC连接OpenHarmony设备,如RK3568开发板等。 ![图片说明](figures/SmartPerfReport1.png) ![图片说明](figures/SmartPerfReport2.png) -**SmartPerf-Daemon命令行使用示例,详细请参考[SmartPerf-Daemon使用](device_command/README_zh.md)** +**Device服务端(bin名称:SP_daemon)命令行使用示例,详细请参考[Device服务端](device_command/README_zh.md)** 1.进入shell, 执行查看帮助命令。 ``` diff --git a/device/device_command/README_zh.md b/device/device_command/README_zh.md index 3b7cf07eb916f1ea9194585a440fb891a516f786..6cb635d32e0c89080352053b5795ef3777908a8f 100644 --- a/device/device_command/README_zh.md +++ b/device/device_command/README_zh.md @@ -1,15 +1,15 @@ -# SmartPerf-Daemon(SP_daemon) +# Device服务端(bin名称:SP_daemon) ## 简介 -- OpenHarmony性能测试工具SmartPerf 命令行版本,可采集CPU、GPU、Temperature、Power、应用RAM、FPS等指标,通过设置采集指标,对采集数据进行实时打印、导出csv。 +- OpenHarmony性能测试工具Device服务端,可通过执行shell命令采集帧率、CPU、GPU、Temperature、Power、应用RAM等指标,通过设置采集指标,对采集数据进行实时打印、导出csv。 -- 性能较差或无屏幕设备请使用命令行版本,带屏幕的设备且性能较好的设备推荐使用[UI版本](../device_ui/README_zh.md)。 +- 性能较差或无屏幕设备请使用Device服务端执行采集,带屏幕的设备且性能较好的设备推荐使用[Device客户端](../device_ui/README_zh.md)。 ## 代码目录 ``` /smartperf/device/device_command ├── include # 头文件目录 -├── BUILD.gn # SP_daemon bin打包配置文件 +├── BUILD.gn # 打包配置文件 ├── ByTrace.cpp # trace抓取代码文件 ├── Capture.cpp # 截图代码文件 ├── CPU.cpp # CPU采集代码文件 @@ -21,13 +21,13 @@ ├── smartperf_command.cpp # 程序执行文件 ├── smartperf_main.cpp # 程序入口文件 ├── sp_profiler_factory.cpp # 采集工厂文件 -├── sp_server_socket.cpp # 与SmartPerf hap通讯代码文件 +├── sp_server_socket.cpp # 与Device客户端通讯代码文件 ├── sp_utils.cpp # 工具类 ├── Temperature.cpp # 温度采集代码文件 ``` ## 约束条件 - SmartPerf应用在3.2系统版本后开始预制使用。 + Device服务端在3.2.5.1系统版本后开始预制使用。 ## 功能特性 @@ -44,13 +44,13 @@ | -f | 是否采集fps。 |否| | -t | 是否采集温度。 |否| | -p | 是否采集电流。 |否| -| -r | 是否采集内存(需指定进程pid)。 |否| +| -r | 是否采集内存(需指定进程pid)。 |否| | -snapshot | 是否截图。 |否| --- **2. 使用方式**
-1)目前命令行版本已系统预制,可以进入shell,执行SP_daemon --help查看。 +1)目前Device服务端已系统预制,可以进入shell,执行SP_daemon --help查看。 ```bash C:\Users\test>hdc_std shell @@ -125,7 +125,7 @@ cpu0freq,cpu0load,cpu1freq,cpu1load,cpu2freq,cpu2load,cpu3freq,cpu3load,current_ ## 发布版本 -**3.2.0.0版本发布内容:预制SP_daemon bin文件,支持以下功能:**
+**3.2.5.1版本发布内容:预制Device服务端,支持以下功能:**
1. 支持RK3568、Hi3516。
2. 支持Shell启动。
3. 支持采集整机CPU、GPU、POWER、TEMPERATURE、应用的FPS、RAM。 \ No newline at end of file diff --git a/device/device_command/gp_utils.cpp b/device/device_command/gp_utils.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e2954eecb97db6600e0058601a4c598bc991a8df --- /dev/null +++ b/device/device_command/gp_utils.cpp @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2021 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. + */ + +#include +#include +#include +#include +#include +#include +#include "securec.h" +#include "include/gp_utils.h" + +namespace OHOS { + namespace SmartPerf { + void GPUtils::mSplit(const std::string &content, const std::string &sp, std::vector &out) + { + size_t index = 0; + while (index != std::string::npos) { + size_t t_end = content.find_first_of(sp, index); + std::string tmp = content.substr(index, t_end - index); + if (tmp != "" && tmp != " ") { + out.push_back(tmp); + } + if (t_end == std::string::npos) { + break; + } + index = t_end + 1; + } + } + + bool GPUtils::canOpen(const std::string &path) + { + if (access(path.c_str(), F_OK) == -1) { + return false; + } + FILE *fp = fopen(path.c_str(), "r"); + if (fp == nullptr) { + return false; + } + if (fclose(fp) == EOF) { + return false; + } + return true; + } + + // popen + std::string GPUtils::readFile(const std::string &cmd) + { + const int buffLengh = 1024; + std::string res = "NA"; + FILE *fp = popen(cmd.c_str(), "r"); + char line[buffLengh]; + line[0] = '\0'; + while (fgets(line, buffLengh, fp) != nullptr) { + res = std::string(line); + } + + if (pclose(fp) == EOF) { + return ""; + } + return res; + } + + // fopen + std::string GPUtils::freadFile(const std::string &path) + { + std::string res = "NA"; + const int buffLengh = 1024; + if (access(path.c_str(), F_OK) == -1) { + return res; + } + FILE *fp; + if ((fp = fopen(path.c_str(), "r")) != nullptr) { + char s[buffLengh]; + s[0] = '\0'; + while (fgets(s, sizeof(s), fp) != nullptr) { + res += std::string(s); + } + } + if (fp != nullptr) { + fclose(fp); + } + return res; + } + + // get number_str from str + std::string GPUtils::getNumber(const std::string &str) + { + int cntInt = 0; + const int shift = 10; + + for (int i = 0; str[i] != '\0'; ++i) { + if (str[i] >= '0' && str[i] <= '9') { + cntInt *= shift; + cntInt += str[i] - '0'; + } + } + return std::to_string(cntInt); + } + + // wirte to csv by path + void GPUtils::writeCsv(const std::string &path, std::vector &vmap) + { + std::ofstream outFile; + char realPath[PATH_MAX + 1] = {0x00}; + if (strlen(path.c_str()) > PATH_MAX || realpath(path.c_str(), realPath) == NULL) { + return; + } + + outFile.open(path.c_str(), std::ios::out); + int i = 0; + std::string title = ""; + for (GPData gpdata : vmap) { + std::map::iterator iter; + std::string line_content = ""; + for (iter = gpdata.values.begin(); iter != gpdata.values.end(); ++iter) { + if (i == 0) { + title += iter->first + ","; + } + line_content += iter->second + ","; + } + if (i == 0) { + title.pop_back(); + outFile << title << std::endl; + } + line_content.pop_back(); + outFile << line_content << std::endl; + ++i; + } + outFile.close(); + } + } +} diff --git a/device/device_command/include/gp_constant.h b/device/device_command/include/gp_constant.h new file mode 100644 index 0000000000000000000000000000000000000000..ca085571336dd8a7066607a2cd617b14f9c6d145 --- /dev/null +++ b/device/device_command/include/gp_constant.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 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. + */ +#ifndef GP_CONSTANT_H +#define GP_CONSTANT_H +enum NumberConstant { + ZERO = 0X00, + ONE = 0X01, + TWO = 0X02, + THREE = 0X03 +}; +enum FunConstant { + SUCCESS_ONE = 0X01, + SUCCESS_ZERO = 0X00, + ERROR_ZERO = 0X00, + ERROR_MINUX = 0xFFFFFFFF +}; +#endif \ No newline at end of file diff --git a/device/device_command/include/gp_data.h b/device/device_command/include/gp_data.h new file mode 100644 index 0000000000000000000000000000000000000000..05c939bfe63cacdf68dac7b9813d88cfac2ca375 --- /dev/null +++ b/device/device_command/include/gp_data.h @@ -0,0 +1,23 @@ +/* +* Copyright (C) 2021 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. +*/ +#ifndef GPDATA_H +#define GPDATA_H +#include + +class GPData { +public: + std::map values; +}; +#endif \ No newline at end of file diff --git a/device/device_command/include/gp_utils.h b/device/device_command/include/gp_utils.h new file mode 100644 index 0000000000000000000000000000000000000000..37b06507a7f6a7515ada47dab619bd35d31e38af --- /dev/null +++ b/device/device_command/include/gp_utils.h @@ -0,0 +1,38 @@ +/* +* Copyright (C) 2021 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. +*/ +#ifndef GP_UTILS_H +#define GP_UTILS_H +#include +#include +#include "gp_data.h" +namespace OHOS { + namespace SmartPerf { + namespace GPUtils { + void mSplit(const std::string &content, const std::string &sp, std::vector &out); + + bool canOpen(const std::string &path); + + std::string readFile(const std::string &cmd); + + std::string freadFile(const std::string &path); + + std::string getNumber(const std::string &str); + + void writeCsv(const std::string &path, std::vector &vmap); + }; + } +} + +#endif // GP_UTILS_H diff --git a/device/device_command/include/profiler.h b/device/device_command/include/profiler.h new file mode 100644 index 0000000000000000000000000000000000000000..c5db299be537608cf5f3f1dcca80c6615c012c6a --- /dev/null +++ b/device/device_command/include/profiler.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2021 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. + */ +#ifndef PROFILER_H +#define PROFILER_H +#include +#include +#include "CPU.h" +#include "GPU.h" +#include "DDR.h" +#include "FPS.h" +#include "RAM.h" +#include "Temperature.h" +#include "Power.h" +#include "ByTrace.h" +#include "gp_data.h" + +namespace OHOS { +namespace SmartPerf { +class Profiler : public DelayedSingleton{ +public: + void initProfiler(); + void createCpu(std::map &gpMap); + void createGpu(std::map &gpMap); + void createDdr(std::map &gpMap); + void createFps(int isVideo, int isCamera, int isCatchTrace, int curProfilerNum, + std::map &gpMap); + void createTemp(std::map &gpMap); + void createPower(std::map &gpMap); + void createRam(const std::string &pkg_name, std::map &gpMap, int pid); + void createSnapshot(std::map &gpMap, long long timestamp); + std::shared_ptr mCpu = nullptr; + std::shared_ptr mGpu = nullptr; + std::shared_ptr mDdr = nullptr; + std::shared_ptr mFps = nullptr; + std::shared_ptr mRam = nullptr; + std::shared_ptr mTemperature = nullptr; + std::shared_ptr mPower = nullptr; + std::shared_ptr mByTrace = nullptr; +}; +} +} +#endif \ No newline at end of file diff --git a/device/device_command/include/socket_profiler.h b/device/device_command/include/socket_profiler.h new file mode 100644 index 0000000000000000000000000000000000000000..84a91f5986f12b3e66297f8c4fe10082555c1b66 --- /dev/null +++ b/device/device_command/include/socket_profiler.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2021 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. + */ +#ifndef SOCKET_PROFILER_H +#define SOCKET_PROFILER_H +#include +#include +#include "CPU.h" +#include "GPU.h" +#include "DDR.h" +#include "FPS.h" +#include "RAM.h" +#include "Temperature.h" +#include "Power.h" +#include "ByTrace.h" +namespace OHOS { +namespace SmartPerf { +class SocketProfiler : public DelayedSingleton { +public: + void initSocketProfiler(); + void bufsendto(int sockLocal, const char *bufsend, int length, struct sockaddr *clientLocal, socklen_t len); + void callSend(std::stringstream &sstream, std::string &str1, std::string &str2); + void thread_udp_server(); + void initSocket(); + + std::shared_ptr mCpu = nullptr; + std::shared_ptr mGpu = nullptr; + std::shared_ptr mDdr = nullptr; + std::shared_ptr mFps = nullptr; + std::shared_ptr mRam = nullptr; + std::shared_ptr mTemperature = nullptr; + std::shared_ptr mPower = nullptr; + std::shared_ptr mByTrace = nullptr; + + int sock; + struct sockaddr_in local; + struct sockaddr_in client; + const size_t SOCK_PORT = 8283; + const size_t BUFF_SIZE_RECV = 256; + const size_t BUFF_SIZE_SEND = 2048; + +}; +} +} +#endif \ No newline at end of file diff --git a/device/device_command/profiler.cpp b/device/device_command/profiler.cpp new file mode 100644 index 0000000000000000000000000000000000000000..62cf658f281abc283f32748e9659ce0c1f3bc660 --- /dev/null +++ b/device/device_command/profiler.cpp @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2021 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. + */ +#include +#include +#include +#include "securec.h" +#include "include/profiler.h" +namespace OHOS { +namespace SmartPerf { +void Profiler::initProfiler() +{ + // get singleton instance + mCpu = CPU::GetInstance(); + mGpu = GPU::GetInstance(); + mDdr = DDR::GetInstance(); + mFps = FPS::GetInstance(); + mRam = RAM::GetInstance(); + mTemperature = Temperature::GetInstance(); + mPower = Power::GetInstance(); + mByTrace = ByTrace::GetInstance(); + + // some init methods + mTemperature->init_temperature(); + mGpu->init_gpu_node(); + mPower->init_power(); + if (mByTrace->init_trace(true) == TraceStatus::TRACE_START) { + std::thread pInitTrace(&ByTrace::thread_get_trace, mByTrace); + } +} + +void Profiler::createCpu(std::map &gpMap) +{ + int cpuCoreNum = mCpu->get_cpu_num(); + for (int i = 0; i < cpuCoreNum; i++) { + int curFreq = mCpu->get_cpu_freq(i); + char desc[10]; + if (snprintf_s(desc, sizeof(desc), sizeof(desc), "cpu%dfreq", i) > 0) { + gpMap.insert(std::pair(std::string(desc), std::to_string(curFreq))); + } + } + + std::vector workloads = mCpu->get_cpu_load(); + + for (size_t i = 1; i < workloads.size(); ++i) { + char desc[10]; + if (snprintf_s(desc, sizeof(desc), sizeof(desc), "cpu%dload", i - 1) > 0) { + gpMap.insert(std::pair(std::string(desc), std::to_string(workloads[i]))); + } + } +} +void Profiler::createGpu(std::map &gpMap) +{ + int ret = mGpu->get_gpu_freq(); + float workload = mGpu->get_gpu_load(); + char desc[10]; + if (snprintf_s(desc, sizeof(desc), sizeof(desc), "gpufreq") > 0) { + gpMap.insert(std::pair(std::string(desc), std::to_string(ret))); + } + if (snprintf_s(desc, sizeof(desc), sizeof(desc), "gpuload") > 0) { + gpMap.insert(std::pair(std::string(desc), std::to_string(workload))); + } +} +void Profiler::createDdr(std::map &gpMap) +{ + long long ret = mDdr->get_ddr_freq(); + char desc[10]; + if (snprintf_s(desc, sizeof(desc), sizeof(desc), "ddrfreq") > 0) { + gpMap.insert(std::pair(std::string(desc), std::to_string(ret))); + } +} +void Profiler::createFps(int isVideo, int isCamera, int isCatchTrace, int curProfilerNum, + std::map &gpMap) +{ + FpsInfo gfpsInfo = mFps->getFpsInfo(isVideo, isCamera); + char desc[10]; + if (snprintf_s(desc, sizeof(desc), sizeof(desc), "fps") > 0) { + gpMap.insert(std::pair(std::string(desc), std::to_string(gfpsInfo.fps))); + } + if (isCatchTrace > 0) { + if (mByTrace->check_fps_jitters(gfpsInfo.jitters, curProfilerNum) == TraceStatus::TRACE_FINISH) { + std::string profilerNum = std::to_string(curProfilerNum); + std::thread pFinishTrace(&ByTrace::thread_finish_trace, mByTrace, std::ref(profilerNum)); + } + } +} +void Profiler::createTemp(std::map &gpMap) +{ + std::map tempInfo = mTemperature->getThermalMap(); + std::map::iterator iter; + for (iter = tempInfo.begin(); iter != tempInfo.end(); ++iter) { + float value = iter->second; + gpMap.insert(std::pair(iter->first, std::to_string(value))); + } +} +void Profiler::createPower(std::map &gpMap) +{ + std::map powerInfo; + powerInfo = mPower->getPowerMap(); + std::map::iterator iter; + for (iter = powerInfo.begin(); iter != powerInfo.end(); ++iter) { + gpMap.insert(std::pair(iter->first, iter->second)); + } +} +void Profiler::createRam(const std::string &pkg_name, std::map &gpMap, int pid) +{ + std::map gramInfo; + gramInfo = mRam->getRamInfo(pkg_name, pid); + std::map::iterator iter; + for (iter = gramInfo.begin(); iter != gramInfo.end(); ++iter) { + gpMap.insert(std::pair(iter->first, iter->second)); + } +} +void Profiler::createSnapshot(std::map &gpMap, long long timestamp) +{ + char pathstr[50]; + std::string path; + if (snprintf_s(pathstr, sizeof(pathstr), sizeof(pathstr), "/data/local/tmp/capture/%lld", timestamp) > 0) { + path = pathstr; + } + char cmdCapture[100]; + if (snprintf_s(cmdCapture, sizeof(cmdCapture), sizeof(cmdCapture), + "snapshot_display -f /data/local/tmp/capture/%lld.png", timestamp) > 0) { + GPUtils::readFile(cmdCapture); + } + gpMap.insert(std::pair(std::string("snapshotPath"), path)); +} +} +} \ No newline at end of file diff --git a/device/device_command/socket_profiler.cpp b/device/device_command/socket_profiler.cpp new file mode 100644 index 0000000000000000000000000000000000000000..08cb87c02566a3f119806341af0d498b5bdcea71 --- /dev/null +++ b/device/device_command/socket_profiler.cpp @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2021 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. + */ +#include +#include +#include +#include +#include "include/gp_utils.h" +#include "include/socket_profiler.h" +namespace OHOS { +namespace SmartPerf { +void SocketProfiler::initSocketProfiler() +{ + mCpu = CPU::GetInstance(); + mGpu = GPU::GetInstance(); + mDdr = DDR::GetInstance(); + mFps = FPS::GetInstance(); + mRam = RAM::GetInstance(); + mTemperature = Temperature::GetInstance(); + mPower = Power::GetInstance(); + mByTrace = ByTrace::GetInstance(); + + mTemperature->init_temperature(); + mGpu->init_gpu_node(); + mPower->init_power(); +} + +void SocketProfiler::bufsendto(int sockLocal, const char *bufsend, int length, + struct sockaddr *clientLocal, socklen_t len) +{ + ssize_t echo_size = sendto(sockLocal, bufsend, length, 0, clientLocal, len); + if (echo_size < 0) { + printf("sendto error, buf is %s\n", bufsend); + } +} + +void SocketProfiler::callSend(std::stringstream &sstream, std::string &str1, std::string &str2) +{ + sstream.str(""); + sstream.clear(); + sstream << str1 << "::" << str2; + std::string streamSend = sstream.str(); + bufsendto(sock, streamSend.c_str(), streamSend.size(), + reinterpret_cast(&client), sizeof(sockaddr_in)); +} + +void SocketProfiler::initSocket() +{ + sock = socket(AF_INET, SOCK_DGRAM, 0); + if (sock < 0) { + perror("socket error"); + } + local.sin_family = AF_INET; + local.sin_port = htons(SOCK_PORT); + local.sin_addr.s_addr = htonl(INADDR_ANY); + if (::bind(sock, reinterpret_cast(&local), sizeof(local)) < 0) { + perror("bind error"); + } +} + +void SocketProfiler::thread_udp_server() +{ + std::shared_ptr SP = SocketProfiler::GetInstance(); + SP->initSocket(); + socklen_t len = sizeof(sockaddr_in); + std::stringstream sstream; + const int loopforever = 1; + printf("enter while loop forever\n"); + while (loopforever) { + char recvbuf[BUFF_SIZE_RECV]; + recvbuf[0] = '\0'; + ssize_t _size = recvfrom(sock, recvbuf, sizeof(recvbuf) - 1, 0, + reinterpret_cast(&client), &len); + if (_size > 0) { + recvbuf[_size] = '\0'; + printf("server recvbuf:%s\n", recvbuf); + } + sstream.str(""); + sstream.clear(); + std::string recv = std::string(recvbuf); + if (recv.find("get_cpu_num") != std::string::npos) { + std::string recvStr = "get_cpu_num"; + int ret = SP->mCpu->get_cpu_num(); + std::string str2 = std::to_string(ret); + SP->callSend(sstream, recvStr, str2); + } else if (recv.find("get_cpu_freq") != std::string::npos) { + std::vector sps; + GPUtils::mSplit(recv, "_", sps); + int cpu_id = std::stoi(sps[sps.size() - 1]); + int ret = SP->mCpu->get_cpu_freq(cpu_id); + std::string str2 = std::to_string(ret); + SP->callSend(sstream, recv, str2); + } else if (recv.find("get_cpu_load") != std::string::npos) { + std::vector workloads = SP->mCpu->get_cpu_load(); + std::string res = ""; + for (size_t i = 0; i < workloads.size(); ++i) { + if (i != 0) { + res += "=="; + } + res += std::to_string(workloads[i]); + } + SP->callSend(sstream, recv, res); + } else if (recv.find("set_pkgName") != std::string::npos) { + std::vector sps; + GPUtils::mSplit(recv, "::", sps); + if (sps.size() > 1) { + SP->mFps->setPackageName(sps[1]); + SP->mRam->setPkgName(sps[1]); + } + } else if (recv.find("get_fps_and_jitters") != std::string::npos) { + std::vector sps; + GPUtils::mSplit(recv, "::", sps); + if (sps.size() > 2) { + int is_video = atoi(sps[1].c_str()); + int is_camera = atoi(sps[2].c_str()); + + FpsInfo gfpsInfo = SP->mFps->getFpsInfo(is_video, is_camera); + std::string res = ""; + res += "timestamp|"; + res += std::to_string(gfpsInfo.current_fps_time); + res += ";"; + res += "fps|"; + res += std::to_string(gfpsInfo.fps); + res += ";"; + res += "jitter|"; + for (size_t i = 0; i < gfpsInfo.jitters.size(); ++i) { + res += std::to_string(gfpsInfo.jitters[i]); + res += "=="; + } + std::string recvStr = "get_fps_and_jitters"; + SP->callSend(sstream, recvStr, res); + } + } else if (recv.find("get_gpu_freq") != std::string::npos) { + int ret = SP->mGpu->get_gpu_freq(); + std::string str2 = std::to_string(ret); + SP->callSend(sstream, recv, str2); + } else if (recv.find("get_gpu_load") != std::string::npos) { + float workload = SP->mGpu->get_gpu_load(); + std::string str2 = std::to_string(workload); + SP->callSend(sstream, recv, str2); + } else if (recv.find("get_ddr_freq") != std::string::npos) { + long long ret = SP->mDdr->get_ddr_freq(); + std::string str2 = std::to_string(ret); + SP->callSend(sstream, recv, str2); + } else if (recv.find("get_ram_info") != std::string::npos) { + std::vector sps; + GPUtils::mSplit(recv, "::", sps); + if (sps.size() > 1) { + std::map gramInfo = SP->mRam->getRamInfo(sps[1], 0); + std::string res = "Pss"; + std::map::iterator iter; + int i = 0; + for (iter = gramInfo.begin(); iter != gramInfo.end(); ++iter) { + if (i != 0) + res += "=="; + res += iter->second; + ++i; + } + SP->callSend(sstream, sps[0], res); + } + } else if (recv.find("get_temperature") != std::string::npos) { + std::map tempInfo = SP->mTemperature->getThermalMap(); + std::string res = ""; + std::map::iterator iter; + int i = 0; + for (iter = tempInfo.begin(); iter != tempInfo.end(); ++iter) { + if (i != 0) { + res += "=="; + } + res += (iter->first + ",," + std::to_string(iter->second)); + ++i; + } + SP->callSend(sstream, recv, res); + } else if (recv.find("get_power") != std::string::npos) { + std::map powerInfo; + powerInfo = SP->mPower->getPowerMap(); + std::string res = ""; + std::map::iterator iter; + int i = 0; + for (iter = powerInfo.begin(); iter != powerInfo.end(); ++iter) { + if (i != 0) { + res += "=="; + } + res += (iter->first + ",," + iter->second); + ++i; + } + SP->callSend(sstream, recv, res); + } else if (recv.find("get_capture") != std::string::npos) { + sstream << "snapshot_display"; + std::string cmd_capture = sstream.str(); + GPUtils::readFile(cmd_capture); + } else if (recv.find("catch_trace_start") != std::string::npos) { + std::thread tStart(&ByTrace::thread_get_trace, SP->mByTrace); + } else if (recv.find("catch_trace_finish") != std::string::npos) { + std::vector traces; + GPUtils::mSplit(recv, "::", traces); + std::thread tFinish(&ByTrace::thread_finish_trace, SP->mByTrace, std::ref(traces[1])); + } + } +} +} +} diff --git a/device/device_ui/.gitignore b/device/device_ui/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ce9e170a7715615dbafb9b2595b55017e7d6696c --- /dev/null +++ b/device/device_ui/.gitignore @@ -0,0 +1,13 @@ +*/build +/build/* +/entry/build/* +/gp_daemon_for_hap/libs/* +/gp_daemon_for_hap/obj/* +/gp_daemon_for_hap/push_x64.bat +/.idea +/local.properties +/node_modules/* +/.deveco/* +/entry/.preview +/entry/.preview/* + diff --git a/device/device_ui/AppScope/app.json5 b/device/device_ui/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f1c18a3fb59df9fa4853abd93a5e94b7cb3fedc9 --- /dev/null +++ b/device/device_ui/AppScope/app.json5 @@ -0,0 +1,13 @@ +{ + "app": { + "bundleName": "com.ohos.gameperceptio", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "minAPIVersion": 8, + "targetAPIVersion": 9 + } +} diff --git a/device/device_ui/README_zh.md b/device/device_ui/README_zh.md index c26c2e940b26013c7df4584674daa8273154386d..2a0d6adc2167497e2669d46bc2f2ae46639a0766 100644 --- a/device/device_ui/README_zh.md +++ b/device/device_ui/README_zh.md @@ -1,15 +1,15 @@ -# SmartPerf.hap +# Device客户端(Hap应用名称:SmartPerf) ## 简介 -- OpenHarmony性能测试工具 SmartPerf UI版本,可采集CPU、GPU、Temperature、Power、应用RAM、FPS等指标,可使用悬浮窗口控制并实时展示测试数据以及支持本地测试报告图表展示功能。 +- OpenHarmony性能测试工具Device客户端,可采集帧率、CPU、GPU、Temperature、Power、应用RAM等指标,支持悬浮窗控制采集、悬浮窗实时展示数据、图形化展示报告等功能。 -- 带屏幕的设备且性能较好的设备推荐使用UI版本,性能较差或无屏幕设备请使用[命令行版本](https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/client/client_command/README_zh.md)。 +- 带屏幕的设备且性能较好的设备推荐使用Device客户端,性能较差或无屏幕设备请使用[Device服务端](../device_command/README_zh.md)。 ## 代码目录 ``` -/developtools/profiler/host/smartperf/client/client_ui -├── AppScope # SmartPerf的包名、应用名称等配置目录 -├── entry # SmartPerf主要代码文件 +/smartperf/device/device_ui +├── AppScope # Device客户端的包名、应用名称等配置目录 +├── entry # Device客户端主要代码文件 │ └── src │ └── main │ ├── ets # ets代码目录 @@ -43,8 +43,8 @@ ``` ## 约束条件 -**1. SmartPerf应用在3.2系统版本后开始预制使用。**
-**2. 使用设备必须是具备屏幕的设备。**
+**1. SmartPerf应用在3.2.5.1系统版本后开始预制使用。**
+**2. Device客户端只能在具备屏幕的设备上使用。**
## 功能特性 **1. 采集指标说明**
@@ -96,7 +96,7 @@ | fpsJitters | 每一帧绘制间隔,单位ns。| **4. 使用操作流程**
-步骤1:进入shell中查看SP_daemon进程是否存在,没有则需启动SP_daemon进程(SP_daemon用于采集fps、ram等指标), 然后打开桌面的Smartperf工具。(采集指标少的时候一般为SP_daemon未启动,或者被后台清理)
+步骤1:使用PC连接设备,进入shell中查看SP_daemon进程是否存在,没有则需启动SP_daemon进程(SP_daemon用于采集帧率、ram等指标), 然后点击桌面的SmartPerf图表,打开Device客户端。(支持的采集指标少的时候一般为SP_daemon未启动,或者被后台清理)
查看SP_daemon进程是否存在 ``` @@ -118,7 +118,7 @@ root 4723 1 0 09:48:50 ? 00:00:00 SP_daemon root 4727 4718 5 09:48:53 pts/0 00:00:00 grep SP_daemon # ``` -步骤2:点击桌面SmartPerf应用图标启动应用,然后点击登录,进入首页,点击开始测试页,选择被测应用,配置采集项(目前支持CPU、GPU、FPS、POWER、TEMP、RAM、截图能力、trace)。
+步骤2:点击桌面SmartPerf应用图标启动应用,然后点击登录,进入首页,点击开始测试页,选择被测应用,配置采集项(目前支持帧率、CPU、GPU、POWER、TEMP、RAM、截图、trace)。
步骤3:选择应用后,点击开始测试、启动悬浮窗(左上角展示),会自动拉起应用,左上角悬浮窗展示start后点击即可开始,展示会变为计时状态,显示当前采集计时。(提示:单击暂停、继续任务,双击展开、关闭详情悬浮窗、点击详情悬浮窗后任意采集项会展开相应采集折线图)。
@@ -129,15 +129,11 @@ root 4727 4718 5 09:48:53 pts/0 00:00:00 grep SP_daemon **5. 其他一些说明**
1)截图目录默认在/data/local/tmp/capture下。
- 2)Trace抓取:当帧绘制时间超过100ms以上会自动抓取trace,1min内只抓取1次,目录在/data目录下,trace文件较大,建议定期清除(文件名称为:mynewtrace[当前时间戳].ftrace)。
- 3) fps采集不到如何解决
- 方法一:后台只能存在一个被测试应用,同应用不能运行多个后台(如果有多个,需清除所有应用,重新启动测试)。
- 方法二:执行hidumper -s 10如出现connect error等错误,尝试kill 掉 hidumper_servic进程,系统会自动再次拉起。 - + 2)trace抓取:当帧绘制时间超过100ms以上会自动抓取trace,1min内只抓取1次,目录在/data目录下,trace文件较大,建议定期清除(文件名称为:mynewtrace[当前时间戳].ftrace)。
## 发布版本 -**3.2.0.0版本布内容:预制smartperf应用,支持以下功能:**
-1. 支持采集CPU、GPU、Temperature、Power、应用RAM、FPS等指标数据采集。
+**3.2.5.1版本布内容:预制Device客户端,支持以下功能:**
+1. 支持采集帧率、CPU、GPU、Temperature、Power、应用RAM等指标数据采集。
2. 悬浮窗控制采集及实时展示数据。
3. 本地图表展示。
diff --git a/device/device_ui/build-profile.json5 b/device/device_ui/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..8da18f847156da22373da0be29ba8c112ca8001c --- /dev/null +++ b/device/device_ui/build-profile.json5 @@ -0,0 +1,26 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + }, + ], + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default", + ], + }, + ], + }, + ], +} \ No newline at end of file diff --git a/device/device_ui/entry/build-profile.json5 b/device/device_ui/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..eeeb460a6f5e502c3ee1b71fa356beab6bf2f37a --- /dev/null +++ b/device/device_ui/entry/build-profile.json5 @@ -0,0 +1,22 @@ +{ + "apiType": 'stageMode', + "buildOption": { + arkEnable: true, + "externalNativeOptions": { + "path": "./src/main/cpp/CMakeLists.txt", + "arguments": "-v -DOHOS_STL=c++_shared", + "abiFilters": [ + "armeabi-v7a", + ], + "cppFlags": "", + } + }, + "targets": [ + { + "name": "default", + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/device/device_ui/entry/src/main/cpp/CMakeLists.txt b/device/device_ui/entry/src/main/cpp/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..96ab5381f4520e2e491dc50053d2cb9058a1c0c2 --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.4.1) +project(XComponent) + +set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +include_directories(${NATIVERENDER_ROOT_PATH} + ${NATIVERENDER_ROOT_PATH}/include + ) +add_library(smartperf SHARED profiler.cpp gp_utils.cpp FPS.cpp RAM.cpp) +target_link_libraries(smartperf PUBLIC libace_napi.z.so libc++.a libhilog_ndk.z.so) \ No newline at end of file diff --git a/device/device_ui/entry/src/main/cpp/FPS.cpp b/device/device_ui/entry/src/main/cpp/FPS.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4fda886dcd60ed63255fe71cb6a63d9a26908637 --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/FPS.cpp @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +#include +#include +#include +#include +#include "gp_utils.h" +#include "FPS.h" + +pthread_mutex_t FPS::mutex; +FPS *FPS::instance = nullptr; +FPS *FPS::getInstance() +{ + if (instance == nullptr) { + pthread_mutex_lock(&mutex); + if (instance == nullptr) { + instance = new FPS(); + } + pthread_mutex_unlock(&mutex); + } + return instance; +} +FPS::FPS() +{ + pthread_mutex_init(&mutex, nullptr); +} +void FPS::setPackageName(std::string pkgName) +{ + pkg_name = std::move(pkgName); +} +FpsInfo FPS::getFpsInfo() +{ + FpsInfo fpsInfoMax; + fpsInfoMax.fps = -1; + + std::string layerName; + + std::vector sps; + gpUtils::mSplit(this->pkg_name, ".", sps); + std::string addEndChar = "0"; + const int pNameLastPos = 2; + std::string pkgSuffix = sps[pNameLastPos]; + layerName = std::string( pkgSuffix.c_str()+ addEndChar); + if (pkgSuffix.find("camera")!=std::string::npos) { + layerName = std::string("RosenRenderXComponent"); + } + + FpsInfo fpsInfo = GetSurfaceFrameDataGB(layerName); + if (fpsInfo.fps > fpsInfoMax.fps) { + fpsInfoMax = fpsInfo; + } + return fpsInfoMax; +} +FpsInfo FPS::GetSurfaceFrameDataGB(std::string name) +{ + if (name == "") { + return FpsInfo(); + } + static std::map fps_map; + if (fps_map.count(name) == 0) { + FpsInfo tmp; + tmp.fps = 0; + tmp.pre_fps = 0; + fps_map[name] = tmp; + } + FpsInfo &fpsInfo = fps_map[name]; + fpsInfo.fps = 0; + FILE *fp; + char tmp[1024]; + tmp[0] = '\0'; + std::string cmd = "hidumper -s 10 -a \"fps " + name + "\""; + fp = popen(cmd.c_str(), "r"); + if (fp == nullptr) { + return fpsInfo; + } + long long MOD = 1e9; + long long lastReadyTime = -1; + int fps_gb = 0; + if (!(fpsInfo.time_stamp_q).empty()) { + lastReadyTime = (fpsInfo.time_stamp_q).back(); + } + bool jump = false; + bool refresh = false; + int cnt = 0; + int zeroNum = 0; + while (fgets(tmp, sizeof(tmp), fp) != nullptr) { + long long frameReadyTime = 0; + sscanf(tmp, "%lld", &frameReadyTime); + cnt++; + if (frameReadyTime == 0) { + zeroNum++; + continue; + } + if (lastReadyTime >= frameReadyTime) { + lastReadyTime = -1; + continue; + } + refresh = true; + long long t_frameReadyTime = frameReadyTime / MOD; + long long t_lastReadyTime = lastReadyTime / MOD; + long long lastFrame = -1; + if (t_frameReadyTime == t_lastReadyTime) { + (fpsInfo.time_stamp_q).push(frameReadyTime); + } else if (t_frameReadyTime == t_lastReadyTime + 1) { + jump = true; + lastFrame = fpsInfo.last_frame_ready_time; + lastReadyTime = frameReadyTime; + int fps_tmp = 0; + fpsInfo.jitters.clear(); + while (!(fpsInfo.time_stamp_q).empty()) { + fps_tmp++; + long long currFrame = (fpsInfo.time_stamp_q.front()); + if (lastFrame != -1) { + long long jitter = currFrame - lastFrame; + fpsInfo.jitters.push_back(jitter); + } + lastFrame = currFrame; + (fpsInfo.time_stamp_q).pop(); + } + fps_gb = fps_tmp; + (fpsInfo.time_stamp_q).push(frameReadyTime); + fpsInfo.last_frame_ready_time = lastFrame; + } else if (t_frameReadyTime > t_lastReadyTime + 1) { + jump = true; + lastReadyTime = frameReadyTime; + while (!(fpsInfo.time_stamp_q).empty()) { + (fpsInfo.time_stamp_q).pop(); + } + (fpsInfo.time_stamp_q).push(frameReadyTime); + } + } + pclose(fp); + const int maxZeroNum = 120; + if (zeroNum >= maxZeroNum) { + while (!(fpsInfo.time_stamp_q.empty())) { + fpsInfo.time_stamp_q.pop(); + } + fpsInfo.fps = 0; + return fpsInfo; + } + const int minPrintLine = 5; + if (cnt < minPrintLine) { + fpsInfo.fps = fpsInfo.pre_fps; + return fpsInfo; + } + if (fps_gb > 0) { + fpsInfo.fps = fps_gb; + fpsInfo.pre_fps = fps_gb; + return fpsInfo; + } else if (refresh && !jump) { + fpsInfo.fps = fpsInfo.pre_fps; + return fpsInfo; + } else { + fpsInfo.fps = 0; + return fpsInfo; + } +} + + diff --git a/device/device_ui/entry/src/main/cpp/FPS.h b/device/device_ui/entry/src/main/cpp/FPS.h new file mode 100644 index 0000000000000000000000000000000000000000..d0e3fb0513d9667cf2cdf2aaa97e660e3027c3ba --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/FPS.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +#ifndef FPS_H +#define FPS_H + +#include +#include +#include +#include +#include "pthread.h" +#include "gp_utils.h" + +struct FpsInfo { + int fps; + int pre_fps; + std::vector jitters; + std::queue time_stamp_q; + long long last_frame_ready_time; + long long current_fps_time; + FpsInfo() + { + fps = 0; + pre_fps = 0; + last_frame_ready_time = 0; + current_fps_time = 0; + } +}; +class FPS{ +public: + static FPS* getInstance(); + FpsInfo getFpsInfo(); + FpsInfo GetSurfaceFrameDataGB(std::string name); + void setPackageName(std::string pkgName); + std::string pkg_name; + static pthread_mutex_t mutex; +private: + FPS(); + ~FPS(){}; + static FPS* instance; +}; + +#endif //FPS_H diff --git a/device/device_ui/entry/src/main/cpp/RAM.cpp b/device/device_ui/entry/src/main/cpp/RAM.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a5f3b4234d2618ba000cdbfb5d6686e88d6a81f9 --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/RAM.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include "gp_utils.h" +#include "RAM.h" + +pthread_mutex_t RAM::mutex; +RAM *RAM::instance = nullptr; +RAM *RAM::getInstance() +{ + if (instance == nullptr) + { + pthread_mutex_lock(&mutex); + if (instance == nullptr) + { + instance = new RAM(); + } + pthread_mutex_unlock(&mutex); + } + return instance; +} +RAM::RAM() +{ + pthread_mutex_init(&mutex, nullptr); +} + +std::map RAM::getRamInfo(std::string pid) +{ + std::map ramInfo; + std::string pss_value = ""; + ramInfo["pss"] = "-1"; + if (pid.size() > 0) { + std::ostringstream cmd_grep; + cmd_grep << "hidumper --mem "; + cmd_grep << pid; + std::string cmd = cmd_grep.str(); + std::string pidLine = gpUtils::readCmd(cmd); + std::vector sps; + gpUtils::mSplit(pidLine, " ", sps); + if (sps.size() > 0) { + pss_value = sps[1]; + } + } + if (atoi(pss_value.c_str()) > 0) { + ramInfo["pss"] = gpUtils::extractNumber(pss_value.c_str()); + } + return ramInfo; +} diff --git a/device/device_ui/entry/src/main/cpp/RAM.h b/device/device_ui/entry/src/main/cpp/RAM.h new file mode 100644 index 0000000000000000000000000000000000000000..997119f8fb8479d21d7192a141ffe1454ca71198 --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/RAM.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef RAM_H +#define RAM_H +#include +#include + +class RAM { +public: + static pthread_mutex_t mutex; + static RAM* getInstance(); + std::map getRamInfo(std::string pid); +private: + RAM(); + ~RAM(){}; + static RAM* instance; +}; + +#endif diff --git a/device/device_ui/entry/src/main/cpp/gp_utils.cpp b/device/device_ui/entry/src/main/cpp/gp_utils.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3845f21635249852007e8956cb432eaf4a6fa288 --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/gp_utils.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +#include +#include +#include +#include +#include "gp_utils.h" + +#define LOG_DOMAIN 0x200 // 标识业务领域,范围0x0~0xFFFFF +#define LOG_TAG "gpUtils" + +namespace gpUtils { + void mSplit(const std::string &content, const std::string &sp, std::vector &out) { + int index = 0; + while (index != std ::string::npos) { + int t_end = content.find_first_of(sp, index); + std::string tmp = content.substr(index, t_end - index); + if (tmp != "" && tmp != " ") + out.push_back(tmp); + if (t_end == std::string::npos) + break; + index = t_end + 1; + } + } + + bool canOpen(const std::string &path) { + FILE* fp; + fp = fopen(path.c_str(), "r"); + if(fp == nullptr){ + return false; + } + fclose(fp); + return true; + } + + bool canCmd(const std::string &cmd) { + FILE* pp; + pp = popen(cmd.c_str(), "r"); + if(pp == nullptr){ + return false; + } + pclose(pp); + return true; + } +} +// popen +std::string gpUtils::readCmd(const std::string &cmd) +{ + const int buffLength = 1024; + std::string res = "NA"; + FILE *pp = popen(cmd.c_str(), "r"); + if (pp == nullptr) { + return res; + } else { + char line[buffLength]; + line[0] = '\0'; + while (fgets(line, buffLength, pp) != nullptr) { + res = std::string(line); + } + } + pclose(pp); + return res; +} + +// fopen +std::string gpUtils::readFile(const std::string &path) +{ + std::string res = "NA"; + const int buffLengh = 1024; + FILE *fp; + if ((fp = fopen(path.c_str(), "r")) != nullptr) { + char s[buffLengh]; + s[0] = '\0'; + while (fgets(s, sizeof(s), fp) != nullptr) { + res += std::string(s); + } + } + if (fp != nullptr) { + fclose(fp); + } + return res; +} +// get number_str from str +std::string gpUtils::extractNumber(const std::string &str) +{ + int cntInt = 0; + const int shift = 10; + + for (int i = 0; str[i] != '\0'; ++i) { + if (str[i] >= '0' && str[i] <= '9') { + cntInt *= shift; + cntInt += str[i] - '0'; + } + } + return std::to_string(cntInt); +} \ No newline at end of file diff --git a/device/device_ui/entry/src/main/cpp/gp_utils.h b/device/device_ui/entry/src/main/cpp/gp_utils.h new file mode 100644 index 0000000000000000000000000000000000000000..6e44d46c25c5b89e32db5ed146fae66027bdc76a --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/gp_utils.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +#ifndef GP_UTILS_H +#define GP_UTILS_H +#include +#include + +namespace gpUtils { + + void mSplit(const std::string &content, const std::string &sp, std::vector& out); + + bool canOpen(const std::string &path); + + bool canCmd(const std::string &cmd); + + std::string extractNumber(const std::string &str); + + std::string readFile(const std::string &path); + + std::string readCmd(const std::string &cmd); +}; + +#endif //GP_UTILS_H diff --git a/device/device_ui/entry/src/main/cpp/profiler.cpp b/device/device_ui/entry/src/main/cpp/profiler.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f96aba319c6937a62bb7ff2c007aaf72af462fd2 --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/profiler.cpp @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "napi/native_api.h" +#include "gp_utils.h" + +#define LOG_DOMAIN 0x200 // 标识业务领域,范围0x0~0xFFFFF +#define LOG_TAG "PROFILER" + +namespace { + void collectFpsThread(std::promise &promiseObj){ + FpsInfo fpsInfo = FPS::getInstance()->getFpsInfo(); + promiseObj.set_value(fpsInfo); + } +} + + +static napi_value getFpsData(napi_env env, napi_callback_info info) +{ + size_t argc = 1; + napi_value args[1] = { nullptr }; + napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); + napi_valuetype valuetype0; + napi_typeof(env, args[0], &valuetype0); + char pkgName[64] = {0}; + size_t typeLen = 0; + napi_get_value_string_utf8(env, args[0], pkgName, 63, &typeLen); + FPS::getInstance()->setPackageName(pkgName); + + std::promise promiseObj; + std::future futureObj = promiseObj.get_future(); + std::thread tFps(collectFpsThread, ref(promiseObj)); + tFps.join(); + + FpsInfo fpsInfo = futureObj.get(); + std::string fps = std::to_string(fpsInfo.fps); + std::vector fpsJitters = fpsInfo.jitters; + std::string fps_str = fps + "|"; + for (int i = 0; i < fpsJitters.size(); ++i) { + fps_str += std::to_string(fpsJitters[i]); + fps_str += "=="; + } + napi_value fps_result; + napi_create_string_utf8(env, fps_str.c_str(), fps_str.size(), &fps_result); + return fps_result; +} + +static napi_value getRamData(napi_env env, napi_callback_info info) +{ + size_t argc = 1; + napi_value args[1] = { nullptr }; + napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); + napi_valuetype valuetype0; + napi_typeof(env, args[0], &valuetype0); + char pidNumber[64] = {0}; + size_t typeLen = 0; + napi_get_value_string_utf8(env, args[0], pidNumber, 63, &typeLen); + std::map gramInfo = RAM::getInstance()->getRamInfo(pidNumber); + std::string ram_pss = gramInfo["pss"]; + napi_value ram_result; + napi_create_string_utf8(env, ram_pss.c_str(), ram_pss.size(), &ram_result); + return ram_result; +} + +static napi_value checkDaemon(napi_env env, napi_callback_info info) +{ + std::string status = "Dead"; + std::string spRunning = gpUtils::readCmd(std::string("ps -ef |grep SP_daemon |grep -v grep")); + if (spRunning.find("NA")!= std::string::npos) { + gpUtils::canCmd(std::string("SP_daemon")); + } else { + status = "Running"; + } + napi_value result; + napi_create_string_utf8(env, status.c_str(), status.size(), &result); + return result; +} + +static napi_value checkAccess(napi_env env, napi_callback_info info) +{ + size_t argc = 1; + napi_value args[1] = { nullptr }; + napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); + napi_valuetype valuetype0; + napi_typeof(env, args[0], &valuetype0); + char pathName[64] = {0}; + size_t typeLen = 0; + napi_get_value_string_utf8(env, args[0], pathName, 63, &typeLen); + std::string pathNameStr = pathName; + std::string status = "PermissionDenied"; + bool isAccess = gpUtils::canOpen(pathNameStr); + if (isAccess) { + status = "PermissionAccessed"; + } + napi_value result; + napi_create_string_utf8(env, status.c_str(), status.size(), &result); + return result; +} + +EXTERN_C_START +static napi_value Init(napi_env env, napi_value exports) +{ + napi_property_descriptor desc[] = { + { "getFpsData", nullptr, getFpsData, nullptr, nullptr, nullptr, napi_default, nullptr }, + { "getRamData", nullptr, getRamData, nullptr, nullptr, nullptr, napi_default, nullptr }, + { "checkDaemon", nullptr, checkDaemon, nullptr, nullptr, nullptr, napi_default, nullptr }, + { "checkAccess", nullptr, checkAccess, nullptr, nullptr, nullptr, napi_default, nullptr }, + }; + napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); + return exports; +} +EXTERN_C_END + +static napi_module demoModule = { +.nm_version = 1, +.nm_flags = 0, +.nm_filename = nullptr, +.nm_register_func = Init, +.nm_modname = "libsmartperf", +.nm_priv = ((void *)0), +.reserved = { 0 }, +}; + +extern "C" __attribute__((constructor)) void RegisterModule(void) +{ +napi_module_register(&demoModule); +} diff --git a/device/device_ui/entry/src/main/cpp/types/libsmartperf/index.d.ts b/device/device_ui/entry/src/main/cpp/types/libsmartperf/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c678fb88d789f48b0907ba50d5ddf36c59d8d8c1 --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/types/libsmartperf/index.d.ts @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const getFpsData: (pkg: string) => string + +export const getRamData: (pid: string) => string + +export const checkDaemon: () => string + +export const checkAccess: (path: string) => string + diff --git a/device/device_ui/entry/src/main/cpp/types/libsmartperf/package.json b/device/device_ui/entry/src/main/cpp/types/libsmartperf/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3af17c2761c46413f7976c43a51fed3c3108925b --- /dev/null +++ b/device/device_ui/entry/src/main/cpp/types/libsmartperf/package.json @@ -0,0 +1,4 @@ +{ + "name": "libsmartperf.so", + "types": "./index.d.ts" +} \ No newline at end of file diff --git a/device/device_ui/entry/src/main/ets/common/profiler/MainWorkTask.ets b/device/device_ui/entry/src/main/ets/common/profiler/MainWorkTask.ets new file mode 100644 index 0000000000000000000000000000000000000000..94ab554b6bd44ed0909dab4c54a8ca97aa1f6fc3 --- /dev/null +++ b/device/device_ui/entry/src/main/ets/common/profiler/MainWorkTask.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import worker from '@ohos.worker'; // 导入worker模块 +import { CatchTraceStatus } from '../profiler/base/ProfilerConstant'; +import SPLogger from '../utils/SPLogger' +export let MainWorker = new worker.Worker("workers/worker.js") + +MainWorker.onmessage = function (e) { + SPLogger.DEBUG("MainWorker","MainWorker recv:" + e.data); + let arr = e.data.split("$") + if (arr[0] == "RAM ") { + globalThis.ramArr.push(arr[1]) + } + if (arr[0] == "FPS") { + globalThis.fpsArr.push(arr[1]) + globalThis.fpsJitterArr.push(arr[2]) + globalThis.timerFps=arr[1] + if (globalThis.catchTraceState == CatchTraceStatus.catch_trace_start + || globalThis.catchTraceState == CatchTraceStatus.catch_trace_finish + || globalThis.catchTraceState == CatchTraceStatus.catch_trace_first_running + ) { + if (globalThis.fpsJitterArr != undefined && globalThis.fpsJitterArr != null && globalThis.fpsJitterArr != "") { + let tempQueue: Array = globalThis.fpsJitterArr + let curJitter = tempQueue.pop() + let tempJitterArr = curJitter.split("==") + for (var i = 0; i < tempJitterArr.length; i++) { + let tmp = tempJitterArr[i] + let jitter = parseInt(tmp) / 1e6 + if (jitter > 100) { + globalThis.jitterTrace = true + return + } + } + } + } + } +} + diff --git a/device/device_ui/entry/src/main/ets/common/profiler/NativeTaskFun.ts b/device/device_ui/entry/src/main/ets/common/profiler/NativeTaskFun.ts new file mode 100644 index 0000000000000000000000000000000000000000..6ee272ff6290308d22bfd9ae9293b46985d03916 --- /dev/null +++ b/device/device_ui/entry/src/main/ets/common/profiler/NativeTaskFun.ts @@ -0,0 +1,49 @@ + +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { getPidOfAbility } from '../utils/SystemUtils'; +import SPLogger from '../utils/SPLogger' +import nativeProfiler from "libsmartperf.so" + + +const TAG = "NativeTaskFun" + +export class NativeTaskFun { + static initAllFun() { + globalThis.CreateNativeFps = ((pkgName: string) => { + let fpsStr: string = nativeProfiler.getFpsData(pkgName) + SPLogger.DEBUG(TAG, "nativeProfiler" + "--> fpsStr:" + fpsStr) + return fpsStr + }) + globalThis.CreateNativeRam = (() => { + let ramStr: string = nativeProfiler.getRamData(globalThis.processPid) + SPLogger.DEBUG(TAG, "nativeProfiler" + "--> ramStr :" + ramStr) + globalThis.ramArr.push(ramStr) + return ramStr + }) + + globalThis.CheckDaemon = (() => { + let status: string = nativeProfiler.checkDaemon() + SPLogger.DEBUG(TAG, "nativeProfiler" + "--> daemon status :" + status) + return status + }) + + globalThis.checkAccess = ((path: string) => { + let status: string = nativeProfiler.checkAccess(path) + SPLogger.DEBUG(TAG, "nativeProfiler --> "+ path + " status :" + status) + return status + }) + } +} diff --git a/device/device_ui/entry/src/main/ets/common/profiler/item/NetWork.ets b/device/device_ui/entry/src/main/ets/common/profiler/item/NetWork.ets new file mode 100644 index 0000000000000000000000000000000000000000..33d19170eea6d0aed7fa61caf95bf205c687298b --- /dev/null +++ b/device/device_ui/entry/src/main/ets/common/profiler/item/NetWork.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { createGPData } from '../base/BaseProfilerUtils'; +import { BaseProfiler } from '../base/BaseProfiler' +import { CollectorType } from '../base/ProfilerConstant' +import connection from '@ohos.net.connection' +import SPLogger from '../../../common/utils/SPLogger' + +export class NetWork extends BaseProfiler{ + private netMap: Map = new Map + private catchNetUp = "-1" + private catchNetDown = "-1" + public static instance: NetWork = null + public static getInstance() { + if (this.instance == null) { + this.instance = new NetWork() + } + return this.instance + } + + init() { + //初始化NET + connection.getDefaultNet().then(function (netHandle) { + connection.getNetCapabilities(netHandle).then(function (info) { + if(info != undefined){ + globalThis.isNetAlive = true + }else{ + globalThis.isNetAlive = false + } + }) + }) + return CollectorType.TYPE_NET + } + + isSupport() { + SPLogger.DEBUG(NetWork.name, "networkInfo support:" + globalThis.isNetAlive) + return globalThis.isNetAlive + } + + readData() { + this.handleMessage() + this.netMap.set("netSpeedUp",this.catchNetUp) + this.netMap.set("netSpeedDown",this.catchNetDown) + return createGPData("NetWork", this.netMap) + } + + handleMessage(){ + var that = this + connection.getDefaultNet().then(function (netHandle) { + connection.getNetCapabilities(netHandle).then(function (info) { + SPLogger.DEBUG(NetWork.name,"networkInfo up:" + info["linkUpBandwidthKbps"] ) + SPLogger.DEBUG(NetWork.name,"networkInfo down:" + info["linkDownBandwidthKbps"]) + that.catchNetDown = info["linkDownBandwidthKbps"].toString() + that.catchNetUp = info["linkUpBandwidthKbps"].toString() + }) + }) + } + +} diff --git a/device/device_ui/entry/src/main/module.json5 b/device/device_ui/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..fe95e0f8a2d476797991c0a1575a440eb74331c4 --- /dev/null +++ b/device/device_ui/entry/src/main/module.json5 @@ -0,0 +1,69 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "./ets/Application/AbilityStage.ts", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone", + "tablet", + "wearable", + "car", + "tv", + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "uiSyntax": "ets", + "requestPermissions": [ + { + "name": "ohos.permission.INTERNET" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.READ_USER_STORAGE" + }, + { + "name": "ohos.permission.WRITE_USER_STORAGE" + }, + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW" + }, + { + "name": "ohos.permission.GET_RUNNING_INFO" + }, + { + "name": "ohos.permission.GET_NETWORK_INFO" + } + ], + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:MainAbility_desc", + "icon": "$media:logo", + "label": "$string:MainAbility_label", + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home", + ], + "actions": [ + "action.system.home", + ], + }, + ], + }, + ], + + }, +} \ No newline at end of file diff --git a/device/device_ui/hvigorfile.js b/device/device_ui/hvigorfile.js new file mode 100644 index 0000000000000000000000000000000000000000..5f2735e3deeaf655828407544bbed9365c258278 --- /dev/null +++ b/device/device_ui/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').appTasks \ No newline at end of file diff --git a/device/device_ui/package.json b/device/device_ui/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6cae94159d31fca180c507559c1f145f4fa9f5f5 --- /dev/null +++ b/device/device_ui/package.json @@ -0,0 +1,14 @@ +{ + "devDependencies":{}, + "name":"OpenHarmony_SP", + "ohos":{ + "org":"ohos", + "directoryLevel":"project", + "buildTool":"hvigor" + }, + "version":"1.0.0", + "dependencies":{ + "@ohos/hvigor-ohos-plugin":"1.0.4-rc", + "@ohos/hvigor":"1.0.4-rc" + } +} \ No newline at end of file diff --git a/device/figures/SmartPerfStru.png b/device/figures/SmartPerfStru.png index 1ddae68adbb452e693258d8e4ae0a52bf43dc247..a9395cc3e5cfc21dbb6952164babb594fa6368a9 100644 Binary files a/device/figures/SmartPerfStru.png and b/device/figures/SmartPerfStru.png differ diff --git a/figures/SmartPerf.png b/figures/SmartPerf.png new file mode 100644 index 0000000000000000000000000000000000000000..913049070a29436219738d88e13ad9c0878a6da9 Binary files /dev/null and b/figures/SmartPerf.png differ diff --git a/host/doc/compile_smartperf.md b/host/doc/compile_smartperf.md index 3f583c19f127775caa1f90c8a14c477483da3835..adb201c5928bbecc490b217bcb82e32c277deaa0 100644 --- a/host/doc/compile_smartperf.md +++ b/host/doc/compile_smartperf.md @@ -1,93 +1,118 @@ -# SmartPerf 编译指导 +# SmartPerf 编译部署指导文档 ## 1. 编译环境搭建: - 注意:在linux编译环境安装时以root或者其他 sudo 用户身份运行下面的命令 +注意:在linux编译环境安装时以root或者其他 sudo 用户身份运行下面的命令 ### 1.1 node 环境安装: ##### 1.1.1 下载Node js安装包(windows推荐, linux跳过此步骤) - 从网站 下载node js安装包 https://nodejs.org/en/download/current/ +从网站下载node js安装包 https://nodejs.org/en/download/current/ ##### 1.1.2 安装nodejs. -- ubuntu 20.04 与Debian 11系统中, 直接用apt-get安装,命令如下: +- ubuntu 20.04 与Debian 11系统中,直接用apt-get安装,先切换到 root用户下,命令如下: ``` - 先切换到 root用户下 sudo su - apt-get update - apt-get install nodejs npm + sudo su + apt-get update + apt-get install nodejs npm ``` +![](../figures/deploy/install_node.png) -- centos 系统中 使用yum 安装,命令如下: + +- centos 系统中使用yum安装,先切换到root用户下,命令如下: ``` - 先切换到 root用户下 sudo su - sudo yum -y install nodejs npm + sudo su + sudo yum -y install nodejs npm ``` +![](../figures/deploy/yum_install_node.png) - windows系统中, 用安装包一路next即可: - 安装完成后运行检查是否安装成功: ``` - node -v - npm -v + node -v + npm -v ``` - 出现版本号就代表安装成功了. +![](../figures/deploy/check_version.png) + + 出现版本号就代表安装成功了 ##### 1.1.3 安装tsc typeScript 编译器 - -- 直接使用npm 安装运行命令: +直接使用npm 安装运行命令: ``` -npm install -g typescript - -备注:如果安装失败可以更换npm源,再次尝试. -验证安装完成: - tsc -v + npm install -g typescript + tsc -v ``` + +备注:如果安装失败可以更换npm源,再次尝试. + 验证安装完成: +![](../figures/deploy/install_tsc.png) + ### 1.2 go 编译环境安装: -- ubuntu 环境下直接使用apt安装: +- ubuntu 环境下直接使用apt安装,以root用户执行 ``` - apt-get install golang-go + apt-get install golang-go ``` -- centos 系统中 使用yum 安装,命令如下: +![](../figures/deploy/install_golang.png) -``` -先切换到 root用户下 sudo su +- centos系统中使用yum安装,先切换到root用户下,命令如下: - sudo yum -y install go ``` -- windows 系统请自行下载安装包并完成安装。 + sudo su + sudo yum -y install go +``` +![](../figures/deploy/yum_install_go.png) + +- windows 系统下 从 https://golang.google.cn/dl/ 下载安装包, 一路next 完成 安装即可。 - 安装完成后 命令行运行验证是否安装成功: ``` - go version + go version ``` ## 2. 项目编译: #### 2.1 先下载sql.js的二进制包,: - 从如下 https://github.com/sql-js/sql.js/releases/download/v1.6.2/sqljs-all.zip 获取到sql.js的二进制包. - 将压缩包解压后, 将文件放置到项目third-party 目录下. +从如下 https://github.com/sql-js/sql.js/releases/download/v1.6.2/sqljs-all.zip 获取到sql.js的二进制包. +将压缩包解压后, 将文件放置到项目third-party 目录下. + +![](../figures/deploy/third_party.png) #### 2.2 先编译获取trace_streamer 的二进制包: - 参照:smartperf/trace_streamer/compile_trace_streamer.md 编译出wasm 、linux、Windows版本的二进制文件 - 将获取到二进制文件放入到项目bin目录下,如果项目目录中无bin目录 先创建bin目录. - 然后将trace_streamer的二进制文件放入bin目录中. +参照:smartperf/trace_streamer/compile_trace_streamer.md 编译出wasm 、linux、Windows版本的二进制文件 +将获取到二进制文件放入到项目bin目录下,如果项目目录中无bin目录 先创建bin目录. +然后将trace_streamer的二进制文件放入bin目录中. + +![](../figures/deploy/put_bin.png) +![](../figures/deploy/bin_files.png) #### 2.3 代码编译(依赖于上面node环境 和 go环境) - 1) 在项目目录安装项目依赖: +1)在项目目录安装项目依赖: +``` npm install - 2) 在项目目录下运行命令: +``` +2)在项目目录下运行命令: +``` npm run compile +``` +![](../figures/deploy/compile.png) 编译成功后会有main 可执行文件生成 ## 3. 项目部署: - 1. linux 版本部署需要给trace_stream程序赋予执行权限: - cd dist/bin 目录下,执行 chmod +x trace_streamer_* - - 直接运行 ./main 可执行程序,完成项目的部署; + 1. linux 版本部署需要给trace_stream程序赋予执行权限: +cd dist/bin 目录下,执行 +``` + chmod +x trace_streamer_* +``` +![](../figures/deploy/chomd+x.png) +直接运行 ./main 可执行程序,完成项目的部署; +![](../figures/deploy/run_main.png) ## 4. 访问项目: - 在浏览器上打开 https://[部署机器ip地址]:9001/application/ - !!! 注意一定是https. +在浏览器上打开 https://[部署机器ip地址]:9000/application/ +!!! 注意一定是https. + +![](../figures/deploy/visit_website.png) - 备注:如果未出现如图所示网页.而是显示 无法访问此网站 - 可以在window cmd 里执行telnet [部署机器ip地址] 9001 - 如果显示端口连接失败 可能是防火墙未对9001 端口放开即可 + 备注:如果未出现如图所示网页.而是显示 无法访问此网站 +可以在window cmd 里执行telnet [部署机器ip地址] 9000 +如果显示端口连接失败 可能是防火墙未对9000 端口放开即可 \ No newline at end of file diff --git a/host/doc/compile_trace_streamer.md b/host/doc/compile_trace_streamer.md index b49e34eb624144aa13010efd0abd1e06234a4792..d9591c39781068b1f6cbb45b151e3b21571c1ec9 100644 --- a/host/doc/compile_trace_streamer.md +++ b/host/doc/compile_trace_streamer.md @@ -1,14 +1,83 @@ -# 1.如何独立编译Trace_streamer -尽管本工具(trace_streamer)是在ohos工具箱中的一员,但你依然可以独立编译此工具。 +# 如何独立编译TraceStreamer +尽管TraceStreamer是在ohos工具箱中的一员,但你依然可以独立编译此工具。 -本工具可以编译linux, mac, windows, WebAssembly版本。 +TraceStreamer可以编译为linux, mac, windows, WebAssembly版本。 -本工具默认编译方式是使用gn -+ 编译方式 +本工具默认编译方式是使用gn。 +## 编译步骤 +### 处理第三方库 +因为需要同时支持pc和WebAssembly环境,TraceStreamer构造了一个独立编译编译的环境,需对第三方库的gn脚本做适当的修改,可按下面的步骤进行。 +third_party相关控件下载链接:https://gitee.com/organizations/openharmony/projects +在TraceStreamer的src同级目录下创建third_party目录。 +#### sqlite +1.在第三方库中,找到并下载sqlite组件; +2.把下载的文件解压后,文件夹命名为sqlite放入到third_party目录中; +3.使用下面的命令,把sqlite的BUILD.gn修改为TraceStreamer适用的风格。 ``` -./build.sh linux/wasm +patch -p0 third_party/sqlite/BUILD.gn prebuilts/buildsqlite/sqlite3build.gn.patch ``` -如果需要编译WebAssembly版本,您需要在prebuilts/目录下安装emsdk +#### protobuf +1.在第三方库中,找到并下载protobuf组件; +2.把下载的文件解压后,文件夹命名为protobuf,放入到third_party目录中; +3.使用下面的命令,把protobuf的BUILD.gn修改为TraceStreamer适用的风格。 +``` +patch -p0 third_party/protobuf/BUILD.gn prebuilts/protobuf/protobufbuild.gn.patch +``` +#### googletest +1.在第三方库中,找到并下载googletest组件; +2.把googletest文件夹放入third_party目录中; +3.使用下面的命令,把googletest的BUILD.gn修改为TraceStreamer适用的风格。 +``` +patch -p0 third_party/googletest/BUILD.gn prebuilts/buildgoogletest/googletestbuild.gn.patch +``` +4.找到文件\googletest\include\gtest\internal\ gtest-port.h 把286行 #include // NOLINT修改为 +#undef private +#define private private +#include // NOLINT +#undef private +#define private public +### nlohmann_json +1.在第三方库中,找到并下载third_party_json库; +2.把下载的文件解压后,文件夹命名为json-master,放入到third_party目录中。 + +### 开始编译 +#### 预置条件 +1.您需要先获取一个可用的protoc可执行文件,或者在linux平台上执行: +``` +./build.sh protoc +``` +来生成可用的protoc可执行的程序。 +2.生成proto相关文件对应的pb.h或pb.cc文件 +可执行如下脚本来完成: +``` +./src/protos/protogen.sh +``` +#### 编译linux、mac、windows平台的TraceStreamer +编译不同平台的程序,你需要在各自的PC环境编译,编译脚本会自行识别平台并编译程序。 +目前wasm版本仅支持在linux或mac平台编译。 +编译不同版本:linux, windows, mac: +``` +./build.sh +``` +特别地,如果你需要编译debug版本的应用,只需要输入debug标识即可,否则,默认是release版本的应用。 +``` +./build.sh linux debug +``` +生成的可执行文件分别位于如下路径: +``` +out/linux +out/windows +out/macx +out/linux_debug +``` +___在不同的平台上,均需要gn和ninja的可执行文件来执行gn工程相关的操作,比如,windows上是gn.exe和ninja.exe。 +在https://gitee.com/su_fu/public_tools/tree/master/gn目录下,您可以获取不同平台下可用的gn和ninja可执行文件,同时,为linux平台下提供了protoc可执行文件。你可以下载并部署在本地的prebuilts目录下。您也可以在linux平台下执行:___ +``` +./build.sh protoc +``` +___来生成out/linux/protoc可执行文件。___ +#### 编译WebAssembly版本 +如果需要编译WebAssembly版本,您需要在prebuilts/目录下安装emsdk。 ``` git clone https://github.com/juj/emsdk.git --depth=1 cd emsdk @@ -16,9 +85,9 @@ git pull ./emsdk update # this may not work, ignore it ./emsdk install latest ./emsdk activate latest -安装之后,您需要将upstream目录复制到prebuilts/emsdk/emsdk,node复制到prebuilts/emsdk/node ``` -安装之后,目录结构当如: +安装之后,您需要将upstream目录复制到prebuilts/emsdk/emsdk,node复制到prebuilts/emsdk/node。 +安装之后,目录结构当如下: ``` prebuilts/emsdk ├── prebuilts/emsdk/emsdk @@ -46,88 +115,8 @@ prebuilts/emsdk ├── prebuilts/emsdk/node/14.18.2_64bit/lib └── prebuilts/emsdk/node/14.18.2_64bit/share ``` -之后调用 -``` -./build.sh wasm进行编译,您需要将sh脚本进行部分修改,因为这个脚本内置了一些库的下载和解析方式 +之后,在TraceStream代码根目录,也就是这个文档的上级目录下执行: ``` -本工具还支持使用QtCreator来编译。 - -src/trace_streamer.pro 是工程文件,编译本工具需要依赖Sqlite库和一些基于proto的pb.h文件 -## 2 准备工程 -### 2.1 基于proto文件生成pb文件 -您需要自行下载并编译一个当前系统(linux)可用的proobuf/protoc程序,此全路径为位于out/linux/protoc -src/protos目录下有一个protogen.sh文件,运行该文件可以在third_party/protogen目录下生成项目需要的pb相关文件 -序列化二进制的解析依赖于基于proto生成的.pb.cc文件。 -在执行protogen.sh脚本之后 -你的目录结构当类似如下结构: -``` -third_party/protogen/types/plugins/ftrace_data/*.pb.cc -third_party/sqlite/*. -third_party/protobuf/* -``` -### 2.2 获取第三方依赖库 -从 -https://gitee.com/openharmony/third_party_sqlite -获取sqlite3目录到代码根目录的third_party目录 -从 -https://gitee.com/openharmony/third_party_protobuf -获取protobuf目录到代码根目录的third_party目录 -之后,你的目录当如下所示 -trace_streamer/third_party/protobuf -trace_streamer/third_party/sqlite -# 3.(linux和ohos平台)使用gn编译TraceStreamer -在编译WebAssembly目标时,需要将sqlite3和protobuf里面相关的ohos_xxx_library统一修改为source_set -## 3.1 准备gn -在自己的项目中使用gn,必须遵循以下要求: -在根目录创建.gn文件,该文件用于指定CONFIG.gn文件的位置; -在BUILDCONFIG.gn中指定编译时使用的编译工具链; -在独立的gn文件中定义编译使用的工具链; -在项目根目录下创建BUILD.gn文件,指定编译的目标。 -``` -cp prebuilts/gn ./ -``` -不同的操作系统下,你需要获取不同的gn -## 3.2 执行编译 -./build.sh linux debug -或./build.sh linux debug -./build.sh将直接编译linux的release版本 -build.sh wasm 命令将可以编译WebAssembly版本 -特别说明:编译WebAssembly版本需要emSDK支持,你需要将build.sh里面的相关路径做更改,以保证编译时必须的文件是存在的 -# 4 编译Windows版本或Mac版本 -## 4.1 编译依赖文件 -### 4.1.1 编译SqliteLib -使用QtCreator打开prebuiltsprebuilts/buildprotobuf/sqlite.pro -### 4.1.2 编译ProtobufLib -使用QtCreator打开prebuilts/buildprotobuf/protobuf.pro -编译之后,文件结构当如下所示: -``` -lib -├── linux -│ ├── libdl.so -│ └── libsqlite.a -├── linux_debug -│ ├── libprotobuf.a -│ └── libsqlite.a -├── macx -│ ├── libprotobuf.a -│ └── libsqlite.a -├── macx_debug -│ ├── libprotobuf.a -│ └── libsqlite.a -├── windows -│ ├── libprotobuf.a -│ └── libsqlite.a -└── windows_debug - ├── libprotobuf.a - └── libsqlite.a -``` -## 4.2 编译TraceStreamer -之后,使用QtCreator打开src/trace_streamer.pro,选择合适的构建工具,执行 Ctrl + b 即可编译 - -编译之后的可执行文件位于out目录 +./build.sh wasm ``` -- out ----- linux (Linux平台下QtCreator或gn生成) ----- macx (mac平台下QtCreator或gn生成) ----- windows (windows平台下QtCreator或gn生成) -``` \ No newline at end of file +您需要将sh脚本进行部分修改,因为这个脚本内置了一些库的下载和解析方式,你可可以在你的编译环境对此脚本做定制修改。 \ No newline at end of file diff --git a/host/doc/des_stat.md b/host/doc/des_stat.md deleted file mode 100644 index e1048f51e1dbb4e9fbe08a809856d2bba903a5d2..0000000000000000000000000000000000000000 --- a/host/doc/des_stat.md +++ /dev/null @@ -1,413 +0,0 @@ -# TraceStreamer 解析数据状态表 -TraceStreamer使用stat表统计解析trace数据源过程遇到的重要事件状态。通过stat表可以对trace数据源中各个类型事件的数据有一个基本了解。 -## stat表支持统计的事件列表如下: -|event_name | -| ---- | -|binder_transaction | -|binder_transaction_alloc_buf | -|binder_transaction_lock | -|binder_transaction_locked | -|binder_transaction_received | -|binder_transaction_unlock | -|clk_disable | -|clk_enable | -|clk_set_rate | -|clock_disable | -|clock_enable | -|clock_set_rate | -|cpu_frequency | -|cpu_idle | -|hidump_fps | -|hilog | -|ipi_entry | -|ipi_exit | -|irq_handler_entry | -|irq_handler_exit | -|memory | -|native_hook_free | -|native_hook_malloc | -|oom_score_adj_update | -|other | -|print | -|regulator_disable | -|regulator_disable_complete | -|regulator_set_voltage | -|regulator_set_voltage_complete | -|sched_process_exit | -|sched_process_free | -|sched_switch | -|sched_wakeup | -|sched_wakeup_new | -|sched_waking | -|signal_deliver | -|signal_generate | -|softirq_entry | -|softirq_exit | -|softirq_raise | -|suspend_resume | -|sys_enter | -|sys_exit | -|sys_memory | -|sys_virtual_memory | -|task_newtask | -|task_rename | -|trace_bblock_bio_queue | -|trace_block_bio_backmerge | -|trace_block_bio_bounce | -|trace_block_bio_complete | -|trace_block_bio_frontmerge | -|trace_block_bio_remap | -|trace_block_dirty_buffer | -|trace_block_getrq | -|trace_block_plug | -|trace_block_rq_complete | -|trace_block_rq_insert | -|trace_block_rq_issue | -|trace_block_rq_remap | -|trace_event_clock_sync | -|tracing_mark_write | -|workqueue_execute_end | -|workqueue_execute_start | - -## 事件对应解析状态: -每种事件解析数据都有5种状态,描述如下表: -|stat_type|description| -|---- |---- | -|received | 统计trace数据源中总共有多少该事件。| -|data_lost | 统计TraceStreamer解析过程中发现丢失数据条数。 | -|not_match | 统计有多少数据与上下文其他数据不匹配。 | -|not_supported | 统计有多少暂不支持解析该事件(一个事件可能包含多种类型的子事件, TraceStreamer可能支持该事件的一部分子事件)。| -|invalid_data | 统计收到多少条该事件的非法数据。| - -## 数据状态级别 -数据状态级别总共有4种,分别是:info, warn, error,fatal。由于数据的重要性不同,不同事件的同一种状态可能对应不同的级别。 -例如binder_transaction_received的 not_supported状态的数据为info级别,而binder_transaction_alloc_buf的not_supported状态数据为warn级别。 - -## 事件,状态与级别对应关系 -| event_name | stat_type | serverity | -|---- |---- |---- | -| binder_transaction | received | info | -| binder_transaction | data_lost | error | -| binder_transaction | not_match | info | -| binder_transaction | not_supported | info | -| binder_transaction | invalid_data | error | -| binder_transaction_received | received | info | -| binder_transaction_received | data_lost | error | -| binder_transaction_received | not_match | info | -| binder_transaction_received | not_supported | info | -| binder_transaction_received | invalid_data | error | -| binder_transaction_alloc_buf | received | info | -| binder_transaction_alloc_buf | data_lost | error | -| binder_transaction_alloc_buf | not_match | info | -| binder_transaction_alloc_buf | not_supported | warn | -| binder_transaction_alloc_buf | invalid_data | error | -| binder_transaction_lock | received | info | -| binder_transaction_lock | data_lost | error | -| binder_transaction_lock | not_match | info | -| binder_transaction_lock | not_supported | warn | -| binder_transaction_lock | invalid_data | error | -| binder_transaction_locked | received | info | -| binder_transaction_locked | data_lost | error | -| binder_transaction_locked | not_match | info | -| binder_transaction_locked | not_supported | warn | -| binder_transaction_locked | invalid_data | error | -| binder_transaction_unlock | received | info | -| binder_transaction_unlock | data_lost | error | -| binder_transaction_unlock | not_match | info | -| binder_transaction_unlock | not_supported | warn | -| binder_transaction_unlock | invalid_data | error | -| sched_switch | received | info | -| sched_switch | data_lost | error | -| sched_switch | not_match | info | -| sched_switch | not_supported | info | -| sched_switch | invalid_data | error | -| task_rename | received | info | -| task_rename | data_lost | error | -| task_rename | not_match | info | -| task_rename | not_supported | info | -| task_rename | invalid_data | error | -| task_newtask | received | info | -| task_newtask | data_lost | error | -| task_newtask | not_match | info | -| task_newtask | not_supported | info | -| task_newtask | invalid_data | error | -| tracing_mark_write | received | info | -| tracing_mark_write | data_lost | error | -| tracing_mark_write | not_match | info | -| tracing_mark_write | not_supported | info | -| tracing_mark_write | invalid_data | error | -| print | received | info | -| print | data_lost | error | -| print | not_match | info | -| print | not_supported | info | -| print | invalid_data | error | -| sched_wakeup | received | info | -| sched_wakeup | data_lost | error | -| sched_wakeup | not_match | info | -| sched_wakeup | not_supported | info | -| sched_wakeup | invalid_data | error | -| sched_waking | received | info | -| sched_waking | data_lost | error | -| sched_waking | not_match | info | -| sched_waking | not_supported | info | -| sched_waking | invalid_data | error | -| cpu_idle | received | info | -| cpu_idle | data_lost | error | -| cpu_idle | not_match | info | -| cpu_idle | not_supported | info | -| cpu_idle | invalid_data | error | -| cpu_frequency | received | info | -| cpu_frequency | data_lost | error | -| cpu_frequency | not_match | info | -| cpu_frequency | not_supported | info | -| cpu_frequency | invalid_data | error | -| suspend_resume | received | info | -| suspend_resume | data_lost | error | -| suspend_resume | not_match | info | -| suspend_resume | not_supported | info | -| suspend_resume | invalid_data | error | -| workqueue_execute_start | received | info | -| workqueue_execute_start | data_lost | error | -| workqueue_execute_start | not_match | info | -| workqueue_execute_start | not_supported | info | -| workqueue_execute_start | invalid_data | error | -| workqueue_execute_end | received | info | -| workqueue_execute_end | data_lost | error | -| workqueue_execute_end | not_match | info | -| workqueue_execute_end | not_supported | warn | -| workqueue_execute_end | invalid_data | error | -| clock_set_rate | received | info | -| clock_set_rate | data_lost | error | -| clock_set_rate | not_match | info | -| clock_set_rate | not_supported | warn | -| clock_set_rate | invalid_data | error | -| clock_enable | received | info | -| clock_enable | data_lost | error | -| clock_enable | not_match | info | -| clock_enable | not_supported | warn | -| clock_enable | invalid_data | error | -| clock_disable | received | info | -| clock_disable | data_lost | error | -| clock_disable | not_match | info | -| clock_disable | not_supported | warn | -| clock_disable | invalid_data | error | -| clk_set_rate | received | info | -| clk_set_rate | data_lost | error | -| clk_set_rate | not_match | info | -| clk_set_rate | not_supported | warn | -| clk_set_rate | invalid_data | error | -| clk_enable | received | info | -| clk_enable | data_lost | error | -| clk_enable | not_match | info | -| clk_enable | not_supported | warn | -| clk_enable | invalid_data | error | -| clk_disable | received | info | -| clk_disable | data_lost | error | -| clk_disable | not_match | info | -| clk_disable | not_supported | warn | -| clk_disable | invalid_data | error | -| sys_enter | received | info | -| sys_enter | data_lost | error | -| sys_enter | not_match | info | -| sys_enter | not_supported | warn | -| sys_enter | invalid_data | error | -| sys_exit | received | info | -| sys_exit | data_lost | error | -| sys_exit | not_match | info | -| sys_exit | not_supported | warn | -| sys_exit | invalid_data | error | -| regulator_set_voltage | received | info | -| regulator_set_voltage | data_lost | error | -| regulator_set_voltage | not_match | info | -| regulator_set_voltage | not_supported | warn | -| regulator_set_voltage | invalid_data | error | -| regulator_set_voltage_complete | received | info | -| regulator_set_voltage_complete | data_lost | error | -| regulator_set_voltage_complete | not_match | info | -| regulator_set_voltage_complete | not_supported | warn | -| regulator_set_voltage_complete | invalid_data | error | -| regulator_disable | received | info | -| regulator_disable | data_lost | error | -| regulator_disable | not_match | info | -| regulator_disable | not_supported | warn | -| regulator_disable | invalid_data | error | -| regulator_disable_complete | received | info | -| regulator_disable_complete | data_lost | error | -| regulator_disable_complete | not_match | info | -| regulator_disable_complete | not_supported | warn | -| regulator_disable_complete | invalid_data | error | -| ipi_entry | received | info | -| ipi_entry | data_lost | error | -| ipi_entry | not_match | info | -| ipi_entry | not_supported | warn | -| ipi_entry | invalid_data | error | -| ipi_exit | received | info | -| ipi_exit | data_lost | error | -| ipi_exit | not_match | info | -| ipi_exit | not_supported | warn | -| ipi_exit | invalid_data | error | -| irq_handler_entry | received | info | -| irq_handler_entry | data_lost | error | -| irq_handler_entry | not_match | info | -| irq_handler_entry | not_supported | warn | -| irq_handler_entry | invalid_data | error | -| irq_handler_exit | received | info | -| irq_handler_exit | data_lost | error | -| irq_handler_exit | not_match | info | -| irq_handler_exit | not_supported | warn | -| irq_handler_exit | invalid_data | error | -| softirq_raise | received | info | -| softirq_raise | data_lost | error | -| softirq_raise | not_match | info | -| softirq_raise | not_supported | warn | -| softirq_raise | invalid_data | error | -| softirq_entry | received | info | -| softirq_entry | data_lost | error | -| softirq_entry | not_match | info | -| softirq_entry | not_supported | warn | -| softirq_entry | invalid_data | error | -| softirq_exit | received | info | -| softirq_exit | data_lost | error | -| softirq_exit | not_match | info | -| softirq_exit | not_supported | warn | -| softirq_exit | invalid_data | error | -| oom_score_adj_update | received | info | -| oom_score_adj_update | data_lost | error | -| oom_score_adj_update | not_match | info | -| oom_score_adj_update | not_supported | warn | -| oom_score_adj_update | invalid_data | error | -| sched_wakeup_new | received | info | -| sched_wakeup_new | data_lost | error | -| sched_wakeup_new | not_match | info | -| sched_wakeup_new | not_supported | warn | -| sched_wakeup_new | invalid_data | error | -| sched_process_exit | received | info | -| sched_process_exit | data_lost | error | -| sched_process_exit | not_match | info | -| sched_process_exit | not_supported | warn | -| sched_process_exit | invalid_data | error | -| sched_process_free | received | info | -| sched_process_free | data_lost | error | -| sched_process_free | not_match | info | -| sched_process_free | not_supported | warn | -| sched_process_free | invalid_data | error | -| trace_event_clock_sync | received | info | -| trace_event_clock_sync | data_lost | error | -| trace_event_clock_sync | not_match | info | -| trace_event_clock_sync | not_supported | warn | -| trace_event_clock_sync | invalid_data | error | -| memory | received | info | -| memory | data_lost | error | -| memory | not_match | info | -| memory | not_supported | warn | -| memory | invalid_data | error | -| hilog | received | info | -| hilog | data_lost | error | -| hilog | not_match | info | -| hilog | not_supported | warn | -| hilog | invalid_data | error | -| hidump_fps | received | info | -| hidump_fps | data_lost | error | -| hidump_fps | not_match | info | -| hidump_fps | not_supported | warn | -| hidump_fps | invalid_data | error | -| native_hook_malloc | received | info | -| native_hook_malloc | data_lost | error | -| native_hook_malloc | not_match | info | -| native_hook_malloc | not_supported | warn | -| native_hook_malloc | invalid_data | error | -| native_hook_free | received | info | -| native_hook_free | data_lost | error | -| native_hook_free | not_match | info | -| native_hook_free | not_supported | warn | -| native_hook_free | invalid_data | error | -| sys_memory | received | info | -| sys_memory | data_lost | error | -| sys_memory | not_match | info | -| sys_memory | not_supported | warn | -| sys_memory | invalid_data | error | -| sys_virtual_memory | received | info | -| sys_virtual_memory | data_lost | error | -| sys_virtual_memory | not_match | info | -| sys_virtual_memory | not_supported | warn | -| sys_virtual_memory | invalid_data | error | -| signal_generate | received | info | -| signal_generate | data_lost | error | -| signal_generate | not_match | info | -| signal_generate | not_supported | warn | -| signal_generate | invalid_data | error | -| signal_deliver | received | info | -| signal_deliver | data_lost | error | -| signal_deliver | not_match | info | -| signal_deliver | not_supported | warn | -| signal_deliver | invalid_data | error | -| trace_block_bio_backmerge | received | info | -| trace_block_bio_backmerge | data_lost | error | -| trace_block_bio_backmerge | not_match | info | -| trace_block_bio_backmerge | not_supported | warn | -| trace_block_bio_backmerge | invalid_data | error | -| trace_block_bio_bounce | received | info | -| trace_block_bio_bounce | data_lost | error | -| trace_block_bio_bounce | not_match | info | -| trace_block_bio_bounce | not_supported | warn | -| trace_block_bio_bounce | invalid_data | error | -| trace_block_bio_complete | received | info | -| trace_block_bio_complete | data_lost | error | -| trace_block_bio_complete | not_match | info | -| trace_block_bio_complete | not_supported | warn | -| trace_block_bio_complete | invalid_data | error | -| trace_block_bio_frontmerge | received | info | -| trace_block_bio_frontmerge | data_lost | error | -| trace_block_bio_frontmerge | not_match | info | -| trace_block_bio_frontmerge | not_supported | warn | -| trace_block_bio_frontmerge | invalid_data | error | -| trace_bblock_bio_queue | received | info | -| trace_bblock_bio_queue | data_lost | error | -| trace_bblock_bio_queue | not_match | info | -| trace_bblock_bio_queue | not_supported | warn | -| trace_bblock_bio_queue | invalid_data | error | -| trace_block_bio_remap | received | info | -| trace_block_bio_remap | data_lost | error | -| trace_block_bio_remap | not_match | info | -| trace_block_bio_remap | not_supported | warn | -| trace_block_bio_remap | invalid_data | error | -| trace_block_dirty_buffer | received | info | -| trace_block_dirty_buffer | data_lost | error | -| trace_block_dirty_buffer | not_match | info | -| trace_block_dirty_buffer | not_supported | warn | -| trace_block_dirty_buffer | invalid_data | error | -| trace_block_getrq | received | info | -| trace_block_getrq | data_lost | error | -| trace_block_getrq | not_match | info | -| trace_block_getrq | not_supported | warn | -| trace_block_getrq | invalid_data | error | -| trace_block_plug | received | info | -| trace_block_plug | data_lost | error | -| trace_block_plug | not_match | info | -| trace_block_plug | not_supported | warn | -| trace_block_plug | invalid_data | error | -| trace_block_rq_complete | received | info | -| trace_block_rq_complete | data_lost | error | -| trace_block_rq_complete | not_match | info | -| trace_block_rq_complete | not_supported | warn | -| trace_block_rq_complete | invalid_data | error | -| trace_block_rq_insert | received | info | -| trace_block_rq_insert | data_lost | error | -| trace_block_rq_insert | not_match | info | -| trace_block_rq_insert | not_supported | warn | -| trace_block_rq_insert | invalid_data | error | -| trace_block_rq_remap | received | info | -| trace_block_rq_remap | data_lost | error | -| trace_block_rq_remap | not_match | info | -| trace_block_rq_remap | not_supported | warn | -| trace_block_rq_remap | invalid_data | error | -| trace_block_rq_issue | received | info | -| trace_block_rq_issue | data_lost | error | -| trace_block_rq_issue | not_match | info | -| trace_block_rq_issue | not_supported | warn | -| trace_block_rq_issue | invalid_data | error | -| other | received | info | -| other | data_lost | error | -| other | not_match | info | -| other | not_supported | warn | -| other | invalid_data | error | diff --git a/host/doc/des_support_event.md b/host/doc/des_support_event.md deleted file mode 100644 index bde55dce0c0d849fdf69f5ed882f6d12c9037228..0000000000000000000000000000000000000000 --- a/host/doc/des_support_event.md +++ /dev/null @@ -1,224 +0,0 @@ -# TraceStreamer支持解析事件列表 -## ftrace事件 -``` -binder_transaction -binder_transaction_received -binder_transaction_alloc_buf -binder_transaction_lock -binder_transaction_locked -binder_transaction_unlock -sched_switch -task_rename -task_newtask -tracing_mark_write -print -sched_wakeup -sched_waking -cpu_idle -cpu_frequency -suspend_resume -workqueue_execute_start -workqueue_execute_end -clock_set_rate -clock_enable -clock_disable -clk_set_rate -clk_enable -clk_disable -sys_enter -sys_exit -regulator_set_voltage -regulator_set_voltage_complete -regulator_disable -regulator_disable_complete -ipi_entry -ipi_exit -irq_handler_entry -irq_handler_exit -softirq_raise -softirq_entry -softirq_exit -sched_wakeup_new -sched_process_exit -trace_event_clock_sync -``` -## 内存事件 -``` -mem.vm.size -mem.rss -mem.rss.anon -mem.rss.file -mem.rss.schem -mem.swap -mem.locked -mem.hwm -mem.oom_score_adj -``` -## 系统内存事件 -``` -sys.mem.unspecified -sys.mem.total -sys.mem.free -sys.mem.avaiable -sys.mem.buffers -sys.mem.cached -sys.mem.swap.chard -sys.mem.active -sys.mem.inactive -sys.mem.active.anon -sys.mem.inactive.anon -sys.mem.active_file -sys.mem.inactive_file -sys.mem.unevictable -sys.mem.mlocked -sys.mem.swap.total -sys.mem.swap.free -sys.mem.dirty -sys.mem.writeback -sys.mem.anon.pages -sys.mem.mapped -sys.mem.shmem -sys.mem.slab -sys.mem.slab.reclaimable -sys.mem.slab.unreclaimable -sys.mem.kernel.stack -sys.mem.page.tables -sys.mem.commit.limit -sys.mem.commited.as -sys.mem.vmalloc.total -sys.mem.vmalloc.used -sys.mem.vmalloc.chunk -sys.mem.cma.total -sys.mem.cma.free -``` -## 系统虚拟内存事件 -``` -sys.virtual.mem.unspecified -sys.virtual.mem.nr.free.pages -sys.virtual.mem.nr.alloc.batch -sys.virtual.mem.nr.inactive.anon -sys.virtual.mem.nr.active_anon -sys.virtual.mem.nr.inactive.file -sys.virtual.mem.nr.active_file -sys.virtual.mem.nr.unevictable -sys.virtual.mem.nr.mlock -sys.virtual.mem.anon.pages -sys.virtual.mem.nr.mapped -sys.virtual.mem.nr.file.pages -sys.virtual.mem.nr.dirty -sys.virtual.mem.nr.writeback -sys.virtual.mem.nr.slab.reclaimable -sys.virtual.mem.nr.slab.unreclaimable -sys.virtual.mem.nr.page_table.pages -sys.virtual.mem.nr_kernel.stack -sys.virtual.mem.nr.overhead -sys.virtual.mem.nr.unstable -sys.virtual.mem.nr.bounce -sys.virtual.mem.nr.vmscan.write -sys.virtual.mem.nr.vmscan.immediate.reclaim -sys.virtual.mem.nr.writeback_temp -sys.virtual.mem.nr.isolated_anon -sys.virtual.mem.nr.isolated_file -sys.virtual.mem.nr.shmem -sys.virtual.mem.nr.dirtied -sys.virtual.mem.nr.written -sys.virtual.mem.nr.pages.scanned -sys.virtual.mem.workingset.refault -sys.virtual.mem.workingset.activate -sys.virtual.mem.workingset_nodereclaim -sys.virtual.mem.nr_anon.transparent.hugepages -sys.virtual.mem.nr.free_cma -sys.virtual.mem.nr.swapcache -sys.virtual.mem.nr.dirty.threshold -sys.virtual.mem.nr.dirty.background.threshold -sys.virtual.mem.vmeminfo.pgpgin -sys.virtual.mem.pgpgout -sys.virtual.mem.pgpgoutclean -sys.virtual.mem.pswpin -sys.virtual.mem.pswpout -sys.virtual.mem.pgalloc.dma -sys.virtual.mem.pgalloc.normal -sys.virtual.mem.pgalloc.movable -sys.virtual.mem.pgfree -sys.virtual.mem.pgactivate -sys.virtual.mem.pgdeactivate -sys.virtual.mem.pgfault -sys.virtual.mem.pgmajfault -sys.virtual.mem.pgrefill.dma -sys.virtual.mem.pgrefill.normal -sys.virtual.mem.pgrefill.movable -sys.virtual.mem.pgsteal.kswapd.dma -sys.virtual.mem.pgsteal.kswapd.normal -sys.virtual.mem.pgsteal.kswapd.movable -sys.virtual.mem.pgsteal.direct.dma -sys.virtual.mem.pgsteal.direct.normal -sys.virtual.mem.pgsteal_direct.movable -sys.virtual.mem.pgscan.kswapd.dma -sys.virtual.mem.pgscan_kswapd.normal -sys.virtual.mem.pgscan.kswapd.movable -sys.virtual.mem.pgscan.direct.dma -sys.virtual.mem.pgscan.direct.normal -sys.virtual.mem.pgscan.direct.movable -sys.virtual.mem.pgscan.direct.throttle -sys.virtual.mem.pginodesteal -sys.virtual.mem.slabs_scanned -sys.virtual.mem.kswapd.inodesteal -sys.virtual.mem.kswapd.low.wmark.hit.quickly -sys.virtual.mem.high.wmark.hit.quickly -sys.virtual.mem.pageoutrun -sys.virtual.mem.allocstall -sys.virtual.mem.pgrotated -sys.virtual.mem.drop.pagecache -sys.virtual.mem.drop.slab -sys.virtual.mem.pgmigrate.success -sys.virtual.mem.pgmigrate.fail -sys.virtual.mem.compact.migrate.scanned -sys.virtual.mem.compact.free.scanned -sys.virtual.mem.compact.isolated -sys.virtual.mem.compact.stall -sys.virtual.mem.compact.fail -sys.virtual.mem.compact.success -sys.virtual.mem.compact.daemon.wake -sys.virtual.mem.unevictable.pgs.culled -sys.virtual.mem.unevictable.pgs.scanned -sys.virtual.mem.unevictable.pgs.rescued -sys.virtual.mem.unevictable.pgs.mlocked -sys.virtual.mem.unevictable.pgs.munlocked -sys.virtual.mem.unevictable.pgs.cleared -sys.virtual.mem.unevictable.pgs.stranded -sys.virtual.mem.nr.zspages -sys.virtual.mem.nr.ion.heap -sys.virtual.mem.nr.gpu.heap -sys.virtual.mem.allocstall.dma -sys.virtual.mem.allocstall.movable -sys.virtual.mem.allocstall.normal -sys.virtual.mem.compact_daemon.free.scanned -sys.virtual.mem.compact.daemon.migrate.scanned -sys.virtual.mem.nr.fastrpc -sys.virtual.mem.nr.indirectly.reclaimable -sys.virtual.mem.nr_ion_heap_pool -sys.virtual.mem.nr.kernel_misc.reclaimable -sys.virtual.mem.nr.shadow_call.stack_bytes -sys.virtual.mem.nr.shmem.hugepages -sys.virtual.mem.nr.shmem.pmdmapped -sys.virtual.mem.nr.unreclaimable.pages -sys.virtual.mem.nr.zone.active.anon -sys.virtual.mem.nr.zone.active.file -ys.virtual.mem.nr.zone.inactive_anon -sys.virtual.mem.nr.zone.inactive_file -sys.virtual.mem.nr.zone.unevictable -sys.virtual.mem.nr.zone.write_pending -sys.virtual.mem.oom.kill -sys.virtual.mem.pglazyfree -sys.virtual.mem.pglazyfreed -sys.virtual.mem.pgrefill -sys.virtual.mem.pgscan.direct -sys.virtual.mem.pgscan.kswapd -sys.virtual.mem.pgskip.dma -sys.virtual.mem.pgskip.movable -sys.virtual.mem.pgskip.normal -sys.virtual.mem.pgsteal.direct -sys.virtual.mem.pgsteal.kswapd -sys.virtual.mem.swap.ra -sys.virtual.mem.swap.ra.hit -``` \ No newline at end of file diff --git a/host/doc/des_tables.md b/host/doc/des_tables.md deleted file mode 100644 index efe0a6f7b4ab4352fc1a9cce82963d86293d8a4e..0000000000000000000000000000000000000000 --- a/host/doc/des_tables.md +++ /dev/null @@ -1,306 +0,0 @@ -# ___概述TraceStreamer生成的数据库___ -``` - TraceStreamer虽然对外提供了各种各样的使用方式,但核心的业务仍是将trace数据源转化为易于理解和使用的数据库。用户可以通过SmartPerf界面直观的研究系统跟踪数据,也可在理解TraceStreamer生成的数据库的基础上,在TraceStreamer的交互模式或者Smartperf的数据库查询模式下,使用SQL查询语句自由组装查看用户关心的数据。 下文将对TraceStreamer生成的数据库进行详细描述,给用户使用SQL查询系统跟踪数据提供帮助。 -``` - -## ___TraceStreamer输出数据库包含以下表格___ -* trace_range : 记录ftrace数据与其他类型数据的时间交集,供前端展示数据时使用。 -* process : 记录进程信息。 -* thread : 记录线程信息。 -* thread_state : 记录线程状态信息。 -* instant : 记录Sched_waking, sched_wakeup事件, 用作ThreadState表的上下文使用。 -* raw : 此数据结构主要作为ThreadState的上下文使用,这张表是sched_waking,sched_wakup, cpu_idle事件的原始记录。 -* callstack : 记录调用堆栈和异步调用,其中depth,stack_id和parent_stack_id仅在非异步调用中有效。当cookid不为空时,为异步调用,此时callid为进程唯一号,否则为线程唯一号。 -* irq : 记录中断相关事件。 -* measure : 记录所有的计量值。 -* log : 记录hilog打印日志数据。 -* heap : 记录堆内存申请与释放相关的数据。 -* heap_frame : 记录堆内存申请与释放相关的调用栈。 -* hidump : 记录FPS(Frame Per Second)数据。 -* symbols : 记录系统调用名称和其函数指针的对应关系,trace中用addr来映射function_name来节省存储空间 -* syscall : 记录用户空间函数与内核空间函数相互调用记录 -* args : 记录方法参数集合 -* sys_event_filter : 记录所有的filter -* clk_event_filter : 记录时钟事件 -* cpu_measure_filter : cpu事件过滤器表。 -* measure_filter : 记录一个递增的filterid队列,所有其他的filter类型在获取过程中,均从此数据列表中获取下一个可用的filter_id并做记录。 -* process_measure_filter : 将进程ID作为key1,进程的内存,界面刷新,屏幕亮度等信息作为key2,唯一确定一个filter_id -* data_type : 记录数据类型和typeId的关联关系。 -* data_dict : 记录常用的字符串,将字符串和索引关联,降低程序运行的内存占用,用作辅助数据。 -* meta : 记录执行解析操作相关的基本信息。 - -## ___表格关系图___ - -### 进程表与线程表关系图: -![GitHub Logo](../figures/process_thread.png) -### 描述: -当一个进程或者线程结束后,系统可能再次将该进程号或者线程号分配给其他进程或者线程,造成一个进程号或线程号代表多个进程或线程的情况。 -Process和Thread表中的id字段可以唯一标识进程和线程。process表中的id在其他表中用作ipid字段。thread表中的id在其他表中用作itid字段。 -thread表通过ipid字段关联process表的id字段,可以查询线程归属进程。 -### 举例: -已知pid = 123,查看当前进程下的所有线程信息,可以使用如下SQL语句: -select thread.* from thread, process where process.pid = 123 and thread.ipid = process.id - -### 线程表与线程运行状态表关系图 -![GitHub Logo](../figures/thread_state.png) -### 描述: -thread_state表记录所有线程的运行状态信息,包含ts(状态起始时间),dur(状态持续时间),cpu, itid, state(线程状态)。 thread表的id字段与thread_state表的itid字段相关联。 -### 举例: -已知tid = 123, 查看当前线程的所有运行状态信息,可以使用如下SQL语句: -select thread_state.* from thread, thread_state where thread.tid = 123 and thread.id = thread_state.itid - -### 堆内存数据变化表关系图 -![GitHub Logo](../figures/dump_and_mem.png) -### 描述: -heap表记录堆内存申请(AllocEvent)和释放(FreeEvent)数据。heap表通过ipid和itid字段分别与process和thread表的id字段关联,通过eventId与heap_frame表的eventId字段相关联。 -heap表字段解释如下: - eventId: 唯一标识一次堆内存申请或释放, 通过与heap_frame表关联可以拿到当前申请或释放的函数调用堆栈。 - addr: 堆内存申请/释放的地址 - heap_size: 堆内存申请/释放的大小 -heap_frame表记录内存申请/释放的调用堆栈。通过eventId区分一组调用堆栈,depth为堆栈深度,depth为0时,表示当前行为栈顶数据。 -### 举例: -已知tid = 123, 查看当前线程的所有堆内存变化信息,可以使用如下SQL语句: -select heap.* from thread, heap where thread.tid = 123 and thread.id = heap.itid -已知eventid = 0, 查看当前内存变化调用堆栈 -select * from heap_frame where eventId = 0 - -### 日志表与进程线程表关系图 -![GitHub Logo](../figures/log.png) -### 描述: -log表记录日志信息。可以根据seq字段的连续性,来判断是否存在日志丢失的情况。 -### 举例: -已知tid = 123, 查看当前线程的所有error级别的日志,可以使用如下SQL语句: -select * from log where tid = 123 and level = "error" - - -## TraceStreamer输出数据库表格详细介绍 -### trace_range表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|start_ts |NUM | -|end_ts |INT | -#### 关键字段描述: -start_ts: trace的开始时间,纳秒为单位 -end_ts: trace的结束时间,纳秒为单位 -### process表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |NUM | -|type |INT | -|pid |NUM | -|name |INT | -|start_ts |NUM | -#### 关键字段描述: -id: 进程在数据库重新重新定义的id,从0开始序列增长 -pid: 进程的真实id -name: 进程名字 -### thread表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |INT | -|type |NUM | -|tid |INT | -|name |NUM | -|start_ts |INT | -|end_ts |INT | -|ipid |INT | -|is_main_thread|INT | -#### 字段详细描述: -id: 线程在数据库重新重新定义的id,从0开始序列增长 -ipid: 线程所属的进程id, 关联进程表中的ID -name: 线程名字 -is_main_thread: 是否主线程,主线程即该线程实际就是进程本身 - -### thread_state表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |INT | -|type |NUM | -|ts |INT | -|dur |INT | -|cpu |INT | -|itid |INT | -|state |NUM | -#### 字段详细描述: -id: 线程状态在数据库中的id,从0开始序列增长 -ts: 该线程状态的起始时间 -dur: 该线程状态的持续时间 -cpu: 该线程在哪个cpu上执行(针对running状态的线程) -itid: 该状态所属的线程所属的进程id, 关联进程表中的ID -state: 线程实际的的状态值 -``` -'R', Runnable状态 -'S', interruptible sleep -'D', uninterruptible sleep -'T', Stoped -'t', Traced -'X', ExitedDead -'Z', ExitZombie -'x', TaskDead -'I', TaskDead -'K', WakeKill -'P', Parked -'N', NoLoad -``` -### instant表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|ts |INT | -|name |NUM | -|ref |INT | -|ref_type |NUM | -#### 表描述: -记录了系统中的waking和wakeup事件。 -### raw表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |INT | -|type |NUM | -|ts |INT | -|name |NUM | -|cpu |INT | -|itid |INT | -#### 表描述: -记录了系统中的waking、wakup、cpu_idel、cpu_frequency数据。 - -### callstack表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |INT | -|ts |INT | -|dur |INT | -|callid |INT | -|cat |NUM | -|name |NUM | -|depth |INT | -|cookie |INT | -|parent_id |INT | -|argsetid |INT | -|chainId |NUM | -|spanId |NUM | -|parentSpanId |NUM | -|flag |NUM | -|args |NUM | -#### 字段详细描述: -dur: 调用时长 -callid: 调用者的ID,比如针对线程表里面的id -name: 调用名称 -depth: 调用深度 -parent_id: 父调用的id - -### measure表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|type |NUM | -|ts |INT | -|value |INT | -|filter_id |INT | -#### 字段详细描述: - -### heap表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|eventId |INT | -|ipid |INT | -|itid |INT | -|event_type |NUM | -|start_ts |INT | -|end_ts |INT | -|dur |INT | -|addr |INT | -|heap_size |INT | -|all_heap_size |INT | -#### 字段详细描述: - -### heap_frame表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|eventId |INT | -|depth |INT | -|ip |INT | -|sp |INT | -|symbol_name |NUM | -|file_path |NUM | -|offset |INT | -|symbol_offset |INT | -#### 表描述: -记录了内存的申请和释放的堆栈。 -### hidump表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|ts |INT | -|fps |INT | -#### 表描述: -此表记录了设备的帧率信息,fps。 -### symbols表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |INT | -|funcname |NUM | -|addr |INT | -#### 表描述: -此表记录了数值和函数调用名称的映射关系。 - -### measure_filter表 -记录一个递增的filterid队列,所有其他的filter类型在获取过程中,均从此数据列表中获取下一个可用的filter_id并做记录。 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |NUM | -|type |NUM | -|name |INT | -|source_arg_set_id |INT | - -#### 字段详细描述: -过滤分类(type),过滤名称(key2),数据ID(key1)。 -数据ID在process_measure_filter, sys_event_filter中作为id。 -### process_measure_filter表 -将进程ID作为key1,进程的内存,界面刷新,屏幕亮度等信息作为key2,唯一确定一个filter_id, filter_id同时被记录在measure_filter表中。 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |INT | -|type |NUM | -|name |NUM | -|ipid |INT | -#### 字段详细描述: -filterid: 来自measure_filter表 -name: cpu状态名 -ipid: 进程内部编号 -### data_type表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |INT | -|typeId |INT | -|desc |NUM | -#### 表描述: -此表记录了一个数据类型ID和数据描述的映射。 -### data_dict表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|id |INT | -|data |NUM | -#### 表描述: -此表记录了一个数据类型ID和字符串的映射。 -### meta表 -#### 表结构: -| Columns Name | SQL TYPE | -|---- |---- | -|name |NUM | -|value |NUM | -#### 表描述: -此表记录了数据解析或导出时的一些现场数据,比如使用的trace_streamer版本, 工具的发布时间,数据解析的时间,数据的持续时长,以及原始数据的格式。 diff --git a/host/doc/quickstart_hiprofiler_cmd.md b/host/doc/quickstart_hiprofiler_cmd.md deleted file mode 100644 index f9a798fb5ae7c8c12a875148b6cd4ed2c319fd30..0000000000000000000000000000000000000000 --- a/host/doc/quickstart_hiprofiler_cmd.md +++ /dev/null @@ -1,39 +0,0 @@ -# 1.hiprofiler_cmd 使用说明 -## 1.1参数说明 - 执行hiprofiler_cmd 为调优业务的离线命令行抓取工具,具体使用方法及命令行参数介绍如下。 - -可以使用`-h`或者`--help`参数查看命令的使用描述信息: - -```sh -# ./hiprofiler_cmd -h -help : - --getport -q : get grpc address - --config -c : start trace by config file - --time -t : trace time - --out -o : output file name - --help -h : make some help -``` - -其余参数使用说明如下: -* `-q`或者`--getport`选项,用于查询服务的端口信息; -* `-c`或者`--config`选项,用于指定配置文件; -* `-t`或者`--time`选项,用于指定抓取时间,单位是秒; -* `-o`或者`--out`选项,用于指定输出的离线数据文件名; -* `-h`或者`--help`选项,用于输出帮助信息; - -# 2.使用具体场景 -![GitHub Logo](../figures/systraceconfig.jpg) -说明: -* Record setting:设置trace的抓取模式,buffer size大小,抓取时长 -* Trace command:生成的抓取命令行 -* Probes config:trace的抓取参数配置 -* Allocations:Nativehook的抓取参数配置 -## 2.1命令行的生成和trace文件的抓取 -点击Probes config,如选择抓取Scheduling details,再点击Record setting,设置buffer size大小,抓取时长 -![GitHub Logo](../figures/Scheduling.jpg) -如下图,就会根据上面的配置生成抓取命令,点击复制按钮,会将命令行复制 -![GitHub Logo](../figures/command.jpg) -进入设备,在执行命令前,需要手动拉起hiprofilerd,hiprofiler_plugins,如果要抓取nativehook数据,还要手动拉起native_daemon,进程都拉起后执行命令 -![GitHub Logo](../figures/excutecommand.jpg) -执行完成后,进入指定目录查看,如/data/local/tmp下就会生成trace文件 -![GitHub Logo](../figures/htrace.jpg) \ No newline at end of file diff --git a/host/doc/quickstart_smartperf.md b/host/doc/quickstart_smartperf.md index b550d64d65d3877f7955d040b701ac214caacc4c..d1748d02cf759054990fcad973bbbbab7b7cdfee 100644 --- a/host/doc/quickstart_smartperf.md +++ b/host/doc/quickstart_smartperf.md @@ -1,66 +1,99 @@ -# 网页加载trace 使用说明 +# 网页加载trace说明 -## 1.打开版本包里面的main.exe可执行文件,启动web页面 -![GitHub Logo](../figures/main.jpg) - -## 2.Web页面展开 -![GitHub Logo](../figures/opentrace.jpg) +## 1.文件加载入口 +将抓取的trace导入查看 +![GitHub Logo](../figures/Web/opentrace.jpg) 说明: + Open trace file:导入离线trace文件入口 + Record new trace:抓取新的trace文件入口 -## 3.导入文件后显示页面 -![GitHub Logo](../figures/trace.jpg) +## 2.导入trace文件后显示页面 +![GitHub Logo](../figures/Web/trace.jpg) 说明: + 操作说明:在当前页面可以通过键盘上的wasd四个键位操纵当前的时间轴进行缩放,w放大,s为缩小,a为左移,d为右移。 -## 功能介绍 -模块从上往下主要展示时间轴和cpu使用率、cpu使用情况、进程间通讯数据的方法调用情况、进程、线程和方法调用情况 +## trace功能介绍 +trace模块从上往下主要展示时间轴、cpu使用率、cpu使用情况、进程间通讯数据的方法调用情况、进程、线程和方法调用情况。 ### 1. 时间轴和cpu使用率 -![GitHub Logo](../figures/figures/time.jpg) +![GitHub Logo](../figures/Web/time.jpg) 最上方带刻度的为时间轴,主要展示当前抓取数据的总时长和时间刻度的分布情况,如上图所示,左下角展示总时长, 中间区域展示的是抓取数据时间段内的cpu使用率,颜色越深代表cpu使用率越高,颜色越浅代表cpu使用率越低。 -![GitHub Logo](../figures/highlit.jpg) +![GitHub Logo](../figures/Web/highlit.jpg) 在白色背景时间轴区域内可以点击后拖拽鼠标,可以对从鼠标按下到拖拽完成鼠标松开的区域内的数据进行筛选,高亮显示的部分为当前所选区域,如上图所示 ### 2.cpu使用情况 -![GitHub Logo](../figures/cpu.jpg) +![GitHub Logo](../figures/Web/cpu.jpg) 如上图所示,当前抓取数据有4个cpu工作,前四组数据对应的是当前调用cpu的线程和对应的进程情况,以颜色作为区分。后四组数据则为cpu的使用频率信息。鼠标移动到相应的线程上还会将当前选中的进程信息全部置为高亮,其他的进程会置灰,如下图所示 -![GitHub Logo](../figures/gray.jpg) +![GitHub Logo](../figures/Web/gray.jpg) #### 2.1.cpu使用情况的框选功能 -可以对cpu的数据进行框选,框选后在最下方的弹出层中会展示框选数据的统计表格,总共有三个tab页 +可以对cpu的数据进行框选,框选后在最下方的弹出层中会展示框选数据的统计表格,总共有七个tab页 CPU by thread的Tab页,主要显示了在框选时间区间内的进程名,进程号,线程名,线程号,总运行时长,平均运行时长和调度次数信息 -![GitHub Logo](../figures/cpubythread.jpg) +![GitHub Logo](../figures/Web/cpubythread.jpg) CPU by process的Tab页,主要显示了在框选时间区间内的进程名,进程号,总运行时长,平均运行时长和调度次数信息 -![GitHub Logo](../figures/cpubyprocess.jpg) +![GitHub Logo](../figures/Web/cpubyprocess.jpg) CPUUsage的Tab页,主要显示了在框选时间区间内,该频率时间占比前三的信息 -![GitHub Logo](../figures/cpusage.jpg) +![GitHub Logo](../figures/Web/cpusage.jpg) +States List的Tab页,按状态>进程>线程的维度去统计,需要呈现该状态的下线程名,进入该状态次数、该状态下时长、最大最小时长,平均时长、最大时长 +![GitHub Logo](../figures/Web/StatesList.jpg) +Switches List的Tab页,按照进程>线程>状态、统计对应状态下的次数 +![GitHub Logo](../figures/Web/Switchlist.jpg) +Thread States的Tab页,按进程>线程>状态的维度去统计,需要呈现该状态的下线程名,进入该状态次数、该状态下时长、最小时长,平均时长、最大时长 +![GitHub Logo](../figures/Web/threadstates.jpg) +Thread Switches的Tab页,按照状态>进程>线程、统计对应状态下的次数 +![GitHub Logo](../figures/Web/threadswitches.jpg) +States List,Switches List,Thread States,Thread Switches的4个Tab页,点击移动到某一行,鼠标会变成一个小手的标志,点击一下,就会进入辅助信息界面,会将选中行的辅助信息展示出来,包括开始时间,进程,线程,线程状态,对应的CPU,优先级等信息如下图 +![GitHub Logo](../figures/Web/details.jpg) #### 2.2.cpu使用情况的单选功能 -单选CPU使用情况数据,单击方法会在选中的方法外层加上深色边框,能够突出当前选中色块,弹出层中会展示当前CPU上的进程名,线程名,开始时间和运行时长,线程运行状态等信息 -![GitHub Logo](../figures/cpuclick.jpg) +单选CPU使用情况数据会在选中的色块外层加上深色边框,能够突出当前选中色块,弹出层中会展示当前CPU上的进程名,线程名,开始时间和运行时长,线程运行状态等信息 +![GitHub Logo](../figures/Web/cpuclick.jpg) ### 3.FPS数据 -FPS是帧率的显示,每秒产生画面的个数 -![GitHub Logo](../figures/fps.jpg) -#### 3.1FPS的框选功能 +FPS是帧率的显示,代表每秒产生画面的个数 +![GitHub Logo](../figures/Web/fps.jpg) +#### 3.1.FPS的框选功能 可以对fps的数据进行框选,框选后在最下方的弹出层中会展示框选时间区间内的统计表格,主要显示了time(时间),FPS(帧率) -![GitHub Logo](../figures/fpsselect.jpg) +![GitHub Logo](../figures/Web/fpsselect.jpg) +#### 3.2.FPS的鼠标悬浮功能 +鼠标移动到帧率的柱状图上,悬浮框会显示当前时间的FPS的值 +![GitHub Logo](../figures/Web/fpstip.jpg) ### 4.进程,线程和方法数据 -下图是进程数据,左边部分展示进程名称和id -![GitHub Logo](../figures/process.jpg) +下图是进程数据,左边部分展示进程名称和id,右边显示线程切换关系,线程的调用方法,进程间内存信息等 +![GitHub Logo](../figures/Web/process.jpg) 点击进程名前面向下箭头可以展开对应的线程进行查看,展开后的线程如下图,如果存在堆内存占用情况,就会显示在第一行,如果出现两个名字和id一样的线程,则第一个为线程的使用情况,第二为线程内的方法栈调用情况 -![GitHub Logo](../figures/threadinfo.jpg) +![GitHub Logo](../figures/Web/threadinfo.jpg) -#### 4.1进程,线程和方法数据的框选功能 +#### 4.1.进程,线程和方法数据的框选功能 可以对线程的数据进行框选,框选后在最下方的弹出层中会展示框选数据的统计表格,包含线程运行状态,线程调用栈的统计情况。当框选的数据中同时存在线程运行状态和线程调用栈数据,下方的弹出层中就会出现多个tab选项,可以进行切换 下图是线程运行状态框选统计信息,包括进程名,进程号,线程名,线程号,线程状态,状态持续时间,平均持续时间,该线程状态发生的次数 -![GitHub Logo](../figures/threadselect.jpg) +![GitHub Logo](../figures/Web/threadselect.jpg) 下图是线程调用栈框选统计信息,包括方法名,持续时间,平均持续时间,调用的次数 -![GitHub Logo](../figures/callstackselect.jpg) -#### 4.2进程,线程和方法数据的单选功能 +![GitHub Logo](../figures/Web/callstackselect.jpg) +#### 4.2.进程,线程和方法数据的单选功能 单选线程的state数据时,会展示当前选中线程的状态数据,开始时间和持续时长,线程状态,所在进程名称、 -![GitHub Logo](../figures/threadclick.jpg) +![GitHub Logo](../figures/Web/threadclick.jpg) 单选调用栈数据,单击方法会在选中的方法外层加上黑色边框,能够突出当前选中的方法,弹出层中会展示当前方法的名称、开始时间和运行时长信息。 -![GitHub Logo](../figures/callstackclick.jpg) - +![GitHub Logo](../figures/Web/callstackclick.jpg) +#### 4.3.线程的跳转功能 +点击画红框处的带箭头的标志,会从CPU的线程概览视图跳转到线程的详情视图,同时从线程的详情视图也能跳转到CPU的线程概览视图 +![GitHub Logo](../figures/Web/jumpthread.jpg) +### 5.trace的其他功能 +#### 5.1.小旗标志的功能 +将选中数据的时间点通过小旗的方式在时间轴上展示,直观的展示选中数据的时间 +![GitHub Logo](../figures/Web/flag.jpg) +在下方输入空输入文字:我是trace,可以给小旗打备注 +![GitHub Logo](../figures/Web/flaginput.jpg) +#### 5.2.收藏置顶功能 +鼠标移动到某个页签,会出现星形的标志,点击该星形,可以将该行收藏置顶 +![GitHub Logo](../figures/Web/stars.jpg) +#### 5.3.勾选功能 +框选某一区域,该区域左边会出现CheckBox的复选框。选中的区域的复选框会出现打勾的状态。可以取消勾选,也可以重新勾选 +![GitHub Logo](../figures/Web/checkbox.jpg) +#### 5.4.搜索功能 +在搜索框中,可以输入线程,线程号等搜索自己想要的信息,搜索完成会高亮显示 +![GitHub Logo](../figures/Web/search.jpg) +在搜索框中输入调用栈的方法名,会跳转到对应的调用栈 +![GitHub Logo](../figures/Web/searchcallstack.jpg) +#### 5.5.M键测量功能 +放大trace中的色块,选中色块,键盘按下M,会出现像尺子一样的形状 +![GitHub Logo](../figures/Web/M.jpg) \ No newline at end of file diff --git a/host/doc/quickstart_trace_streamer.md b/host/doc/quickstart_trace_streamer.md deleted file mode 100644 index eb0deec07b8f4c55fed4152454f49cad6d721cb9..0000000000000000000000000000000000000000 --- a/host/doc/quickstart_trace_streamer.md +++ /dev/null @@ -1,309 +0,0 @@ -# trace_streamer工具说明 -trace_streamer工具可以2种方式使用 -1. 可以将系统离线trace文件解析并转为db,此工具支持基于文本的trace和基于proto的trace。 -2. trace_streamer工具还可以WebAssembly的方式在浏览器中运行,需暴露相关接口给js文件。 - -## 关于trace解析工具的使用说明: -### 导出db模式 -在导出db模式下,trace_streamer.exe trace文件路径名 -e 导出db路径名.db -此命令可以将trace文件转为db -本应用支持在ohos, linux, windows, mac使用。 -关于db文件的说明: -使用db查看工具查看stat表,可以浏览当前数据一共有多少类数据,各类数据都收到多少条,数据是否正常等情况。在meta表会记录数据库导出时的一些系统信息,比如导入和导出的文件全路径,解析时间等信息。 -meta表可以选择不导出(有些情况下会暴露系统敏感信息),在导出时添加 -nm选项即可。 -在数据导出之后,会在本地目录下生成一个trace_streamer.log文件,在导出db的目录下生成一个数据库文件同名,.db.ohos.ts后缀的文件 -文件内容如下: -时间戳:执行结果(数字) -应用运行时间 - -执行结果解释如下:0 代表执行成功 1 表示输入文件不匹配, 2 表示解析错误, 3其他错误 -### 内置浏览器方式 -trace_streamer可以WebAssembly方式在浏览器中运行,暴露如下接口给js -``` -extern "C" { -/* 上传trace数据 - * - * @data: 数据的缓冲区 - * @dataLen: 数据长度 - * - * return: 0:成功; -1:失败 -*/ -EMSCRIPTEN_KEEPALIVE int TraceStreamerParseData(const uint8_t* data, int dataLen); - -/* 通知TS上传trace数据结束 - * - * return: 0:成功; -1:失败 -*/ -EMSCRIPTEN_KEEPALIVE int TraceStreamerParseDataOver(); - -/* 通过sql语句操作数据库 - * - * @sql: sql语句 - * @sqlLen: sql语句长度 - * - * return: 0:成功; -1:失败 -*/ -EMSCRIPTEN_KEEPALIVE int TraceStreamerSqlOperate(const uint8_t* sql, int sqlLen); - -/* 通过sql语句查询数据库 - * - * @sql: sql语句 - * @sqlLen: sql语句长度 - * @out: 查询结果的缓冲区,查询结果为json - * @outLen: 缓冲区长度 - * - * return: >0:查询成功,返回查询结果数据长度; -1:失败 -*/ -EMSCRIPTEN_KEEPALIVE int TraceStreamerSqlQuery(const uint8_t* sql, int sqlLen, uint8_t* out, int outLen); - -} // extern "C" -``` - -### 你也可以执行如下命令查看应用帮助 -./trace_streamer --help --i 选项可查看应用支持的事件源和具体的事件名列表 - -#### trace_streamer支持的事件解析 -本工具支持基于文本的trace(# TRACE)和基于proto的二进制日志文件的解析,支持的事件列表如下: -##### ftrace事件 -``` -binder_transaction -binder_transaction_received -binder_transaction_alloc_buf -binder_transaction_lock -binder_transaction_locked -binder_transaction_unlock -sched_switch -task_rename -task_newtask -tracing_mark_write -print -sched_wakeup -sched_waking -cpu_idle -cpu_frequency -suspend_resume -workqueue_execute_start -workqueue_execute_end -clock_set_rate -clock_enable -clock_disable -clk_set_rate -clk_enable -clk_disable -sys_enter -sys_exit -regulator_set_voltage -regulator_set_voltage_complete -regulator_disable -regulator_disable_complete -ipi_entry -ipi_exit -irq_handler_entry -irq_handler_exit -softirq_raise -softirq_entry -softirq_exit -sched_wakeup_new -sched_process_exit -trace_event_clock_sync -``` -##### 内存事件 -``` -mem.vm.size -mem.rss -mem.rss.anon -mem.rss.file -mem.rss.schem -mem.swap -mem.locked -mem.hwm -mem.oom_score_adj -``` -##### 系统内存事件 -``` -sys.mem.unspecified -sys.mem.total -sys.mem.free -sys.mem.avaiable -sys.mem.buffers -sys.mem.cached -sys.mem.swap.chard -sys.mem.active -sys.mem.inactive -sys.mem.active.anon -sys.mem.inactive.anon -sys.mem.active_file -sys.mem.inactive_file -sys.mem.unevictable -sys.mem.mlocked -sys.mem.swap.total -sys.mem.swap.free -sys.mem.dirty -sys.mem.writeback -sys.mem.anon.pages -sys.mem.mapped -sys.mem.shmem -sys.mem.slab -sys.mem.slab.reclaimable -sys.mem.slab.unreclaimable -sys.mem.kernel.stack -sys.mem.page.tables -sys.mem.commit.limit -sys.mem.commited.as -sys.mem.vmalloc.total -sys.mem.vmalloc.used -sys.mem.vmalloc.chunk -sys.mem.cma.total -sys.mem.cma.free -``` -##### 系统虚拟内存事件 -``` -sys.virtual.mem.unspecified -sys.virtual.mem.nr.free.pages -sys.virtual.mem.nr.alloc.batch -sys.virtual.mem.nr.inactive.anon -sys.virtual.mem.nr.active_anon -sys.virtual.mem.nr.inactive.file -sys.virtual.mem.nr.active_file -sys.virtual.mem.nr.unevictable -sys.virtual.mem.nr.mlock -sys.virtual.mem.anon.pages -sys.virtual.mem.nr.mapped -sys.virtual.mem.nr.file.pages -sys.virtual.mem.nr.dirty -sys.virtual.mem.nr.writeback -sys.virtual.mem.nr.slab.reclaimable -sys.virtual.mem.nr.slab.unreclaimable -sys.virtual.mem.nr.page_table.pages -sys.virtual.mem.nr_kernel.stack -sys.virtual.mem.nr.overhead -sys.virtual.mem.nr.unstable -sys.virtual.mem.nr.bounce -sys.virtual.mem.nr.vmscan.write -sys.virtual.mem.nr.vmscan.immediate.reclaim -sys.virtual.mem.nr.writeback_temp -sys.virtual.mem.nr.isolated_anon -sys.virtual.mem.nr.isolated_file -sys.virtual.mem.nr.shmem -sys.virtual.mem.nr.dirtied -sys.virtual.mem.nr.written -sys.virtual.mem.nr.pages.scanned -sys.virtual.mem.workingset.refault -sys.virtual.mem.workingset.activate -sys.virtual.mem.workingset_nodereclaim -sys.virtual.mem.nr_anon.transparent.hugepages -sys.virtual.mem.nr.free_cma -sys.virtual.mem.nr.swapcache -sys.virtual.mem.nr.dirty.threshold -sys.virtual.mem.nr.dirty.background.threshold -sys.virtual.mem.vmeminfo.pgpgin -sys.virtual.mem.pgpgout -sys.virtual.mem.pgpgoutclean -sys.virtual.mem.pswpin -sys.virtual.mem.pswpout -sys.virtual.mem.pgalloc.dma -sys.virtual.mem.pgalloc.normal -sys.virtual.mem.pgalloc.movable -sys.virtual.mem.pgfree -sys.virtual.mem.pgactivate -sys.virtual.mem.pgdeactivate -sys.virtual.mem.pgfault -sys.virtual.mem.pgmajfault -sys.virtual.mem.pgrefill.dma -sys.virtual.mem.pgrefill.normal -sys.virtual.mem.pgrefill.movable -sys.virtual.mem.pgsteal.kswapd.dma -sys.virtual.mem.pgsteal.kswapd.normal -sys.virtual.mem.pgsteal.kswapd.movable -sys.virtual.mem.pgsteal.direct.dma -sys.virtual.mem.pgsteal.direct.normal -sys.virtual.mem.pgsteal_direct.movable -sys.virtual.mem.pgscan.kswapd.dma -sys.virtual.mem.pgscan_kswapd.normal -sys.virtual.mem.pgscan.kswapd.movable -sys.virtual.mem.pgscan.direct.dma -sys.virtual.mem.pgscan.direct.normal -sys.virtual.mem.pgscan.direct.movable -sys.virtual.mem.pgscan.direct.throttle -sys.virtual.mem.pginodesteal -sys.virtual.mem.slabs_scanned -sys.virtual.mem.kswapd.inodesteal -sys.virtual.mem.kswapd.low.wmark.hit.quickly -sys.virtual.mem.high.wmark.hit.quickly -sys.virtual.mem.pageoutrun -sys.virtual.mem.allocstall -sys.virtual.mem.pgrotated -sys.virtual.mem.drop.pagecache -sys.virtual.mem.drop.slab -sys.virtual.mem.pgmigrate.success -sys.virtual.mem.pgmigrate.fail -sys.virtual.mem.compact.migrate.scanned -sys.virtual.mem.compact.free.scanned -sys.virtual.mem.compact.isolated -sys.virtual.mem.compact.stall -sys.virtual.mem.compact.fail -sys.virtual.mem.compact.success -sys.virtual.mem.compact.daemon.wake -sys.virtual.mem.unevictable.pgs.culled -sys.virtual.mem.unevictable.pgs.scanned -sys.virtual.mem.unevictable.pgs.rescued -sys.virtual.mem.unevictable.pgs.mlocked -sys.virtual.mem.unevictable.pgs.munlocked -sys.virtual.mem.unevictable.pgs.cleared -sys.virtual.mem.unevictable.pgs.stranded -sys.virtual.mem.nr.zspages -sys.virtual.mem.nr.ion.heap -sys.virtual.mem.nr.gpu.heap -sys.virtual.mem.allocstall.dma -sys.virtual.mem.allocstall.movable -sys.virtual.mem.allocstall.normal -sys.virtual.mem.compact_daemon.free.scanned -sys.virtual.mem.compact.daemon.migrate.scanned -sys.virtual.mem.nr.fastrpc -sys.virtual.mem.nr.indirectly.reclaimable -sys.virtual.mem.nr_ion_heap_pool -sys.virtual.mem.nr.kernel_misc.reclaimable -sys.virtual.mem.nr.shadow_call.stack_bytes -sys.virtual.mem.nr.shmem.hugepages -sys.virtual.mem.nr.shmem.pmdmapped -sys.virtual.mem.nr.unreclaimable.pages -sys.virtual.mem.nr.zone.active.anon -sys.virtual.mem.nr.zone.active.file -ys.virtual.mem.nr.zone.inactive_anon -sys.virtual.mem.nr.zone.inactive_file -sys.virtual.mem.nr.zone.unevictable -sys.virtual.mem.nr.zone.write_pending -sys.virtual.mem.oom.kill -sys.virtual.mem.pglazyfree -sys.virtual.mem.pglazyfreed -sys.virtual.mem.pgrefill -sys.virtual.mem.pgscan.direct -sys.virtual.mem.pgscan.kswapd -sys.virtual.mem.pgskip.dma -sys.virtual.mem.pgskip.movable -sys.virtual.mem.pgskip.normal -sys.virtual.mem.pgsteal.direct -sys.virtual.mem.pgsteal.kswapd -sys.virtual.mem.swap.ra -sys.virtual.mem.swap.ra.hit -``` - -## trace_streamer开发环境搭建和编译运行指引 - -本应用使用gn作为构建工具,支持在linux环境同时编译linux,windows和mac使用QtCreator作为开发IDE -### 1、开发环境 -ubuntu使用vscode,windows和mac使用QtCreator -# 对外部的依赖 -本应用依赖与sqlite,protobuf(htrace解析部分依赖) - -本应用同时依赖于src/protos目录下文件来生成相关pb.h,pb.cc文件 - -### 2.1、 编译linux版应用 -在根目录下执行相关命令进行编译 - -### 2.2、编译Windows版和Mac应用 -在项目目录下有pro文件,为QtCreator的工程文件,但部分内容赖在于上面所添加的外部依赖,如果要编译相关平台应用,开发者需自行补充相关工程文件,或者在论坛留言 - -### 2.3、开始编译 -具体方法可参考《compile_trace_streamer.md》 \ No newline at end of file diff --git a/host/figures/Bio/BioCalltree.jpg b/host/figures/Bio/BioCalltree.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ee3f25ddb028fbda43662b7baf976fc990407de8 Binary files /dev/null and b/host/figures/Bio/BioCalltree.jpg differ diff --git a/host/figures/Bio/BioOptions.jpg b/host/figures/Bio/BioOptions.jpg new file mode 100644 index 0000000000000000000000000000000000000000..80dd5a57e9f373cccf373c6b7fda9c3fc513ff15 Binary files /dev/null and b/host/figures/Bio/BioOptions.jpg differ diff --git a/host/figures/Bio/Biochart.jpg b/host/figures/Bio/Biochart.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b5451727c787f29b45ac8a4aad974b9062b30925 Binary files /dev/null and b/host/figures/Bio/Biochart.jpg differ diff --git a/host/figures/Bio/Biocounter.jpg b/host/figures/Bio/Biocounter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c2eedd02185175fe09cd6c180fc3af8777aeb283 Binary files /dev/null and b/host/figures/Bio/Biocounter.jpg differ diff --git a/host/figures/Bio/Biodatamining.jpg b/host/figures/Bio/Biodatamining.jpg new file mode 100644 index 0000000000000000000000000000000000000000..abc7a5dd5bc29966d066e8dacca88f0c6a974948 Binary files /dev/null and b/host/figures/Bio/Biodatamining.jpg differ diff --git a/host/figures/Bio/Bioexcuting.jpg b/host/figures/Bio/Bioexcuting.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fc5bb3891d86b03744d14d10940d406f7fc06a0d Binary files /dev/null and b/host/figures/Bio/Bioexcuting.jpg differ diff --git a/host/figures/Bio/Biofilter.jpg b/host/figures/Bio/Biofilter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..851944c928003870a4693ecae15d08c30c17c50c Binary files /dev/null and b/host/figures/Bio/Biofilter.jpg differ diff --git a/host/figures/Bio/Bioflame.jpg b/host/figures/Bio/Bioflame.jpg new file mode 100644 index 0000000000000000000000000000000000000000..592e6b343243a00ecdefc4aef63b7c6e5d5bc51b Binary files /dev/null and b/host/figures/Bio/Bioflame.jpg differ diff --git a/host/figures/Bio/Bioflamelevel.jpg b/host/figures/Bio/Bioflamelevel.jpg new file mode 100644 index 0000000000000000000000000000000000000000..78d2f14c2ca40f20a231c7dc060a667f08356914 Binary files /dev/null and b/host/figures/Bio/Bioflamelevel.jpg differ diff --git a/host/figures/Bio/Bioflameshow.jpg b/host/figures/Bio/Bioflameshow.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f7e8f9974ee4a6131e87f2164dde82009e2cf0a9 Binary files /dev/null and b/host/figures/Bio/Bioflameshow.jpg differ diff --git a/host/figures/Bio/Bioheaviesttrace.jpg b/host/figures/Bio/Bioheaviesttrace.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e76b66303697967022de21c22e4b7bad1f2e1c93 Binary files /dev/null and b/host/figures/Bio/Bioheaviesttrace.jpg differ diff --git a/host/figures/Bio/Bioinputfilter.jpg b/host/figures/Bio/Bioinputfilter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6d6e6b1a8b250e0eb01b5ba7882d2a0da8f00cc5 Binary files /dev/null and b/host/figures/Bio/Bioinputfilter.jpg differ diff --git a/host/figures/Bio/Biorecord.jpg b/host/figures/Bio/Biorecord.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d4aed0679233db239eb1b34cb06759d88d500399 Binary files /dev/null and b/host/figures/Bio/Biorecord.jpg differ diff --git a/host/figures/Bio/Biosetting.jpg b/host/figures/Bio/Biosetting.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6181cf4ac871a67bb7aa06601e8e7aaaabc061fb Binary files /dev/null and b/host/figures/Bio/Biosetting.jpg differ diff --git a/host/figures/Bio/Biostatistics.jpg b/host/figures/Bio/Biostatistics.jpg new file mode 100644 index 0000000000000000000000000000000000000000..259a9bc8f77c6db6f5516b57b60ed27915406ff5 Binary files /dev/null and b/host/figures/Bio/Biostatistics.jpg differ diff --git a/host/figures/Bio/Biosummary.jpg b/host/figures/Bio/Biosummary.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9d102cd8d03af610d7fa905664401df8334cb539 Binary files /dev/null and b/host/figures/Bio/Biosummary.jpg differ diff --git a/host/figures/Bio/Biotimes.jpg b/host/figures/Bio/Biotimes.jpg new file mode 100644 index 0000000000000000000000000000000000000000..60cd75aca70a6d55a66a26f9bd766fbefe7c6f33 Binary files /dev/null and b/host/figures/Bio/Biotimes.jpg differ diff --git a/host/figures/EBPF/EBPFchart.jpg b/host/figures/EBPF/EBPFchart.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6f19739e32b7cc583fdc46694aabc062db90b86d Binary files /dev/null and b/host/figures/EBPF/EBPFchart.jpg differ diff --git a/host/figures/EBPF/EBPFcount.jpg b/host/figures/EBPF/EBPFcount.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d6ae10d0329df5da0d8f6bef8fda3416b5843036 Binary files /dev/null and b/host/figures/EBPF/EBPFcount.jpg differ diff --git a/host/figures/EBPF/VMCalltree.jpg b/host/figures/EBPF/VMCalltree.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e8cc24bb1dbe1344c2bebed940d59267cd7a1318 Binary files /dev/null and b/host/figures/EBPF/VMCalltree.jpg differ diff --git a/host/figures/EBPF/VMEvents.jpg b/host/figures/EBPF/VMEvents.jpg new file mode 100644 index 0000000000000000000000000000000000000000..67e9995426c8e2983de24e21fd9785e9713e1125 Binary files /dev/null and b/host/figures/EBPF/VMEvents.jpg differ diff --git a/host/figures/EBPF/VMfilter.jpg b/host/figures/EBPF/VMfilter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fb29b5d8c8ca9a6202d96f8f5febf5bf45cd7514 Binary files /dev/null and b/host/figures/EBPF/VMfilter.jpg differ diff --git a/host/figures/EBPF/ebpf_bythread.jpg b/host/figures/EBPF/ebpf_bythread.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eb5bf673a8d9d5244b1f1f61fd04ad9db21e66fc Binary files /dev/null and b/host/figures/EBPF/ebpf_bythread.jpg differ diff --git a/host/figures/EBPF/ebpfcommand.jpg b/host/figures/EBPF/ebpfcommand.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2af7869dba909de20ea57959bddce15a53f3d572 Binary files /dev/null and b/host/figures/EBPF/ebpfcommand.jpg differ diff --git a/host/figures/EBPF/ebpfexcuting.jpg b/host/figures/EBPF/ebpfexcuting.jpg new file mode 100644 index 0000000000000000000000000000000000000000..54b3afd3e2410f60df2c2bd79490d7bc88a902f8 Binary files /dev/null and b/host/figures/EBPF/ebpfexcuting.jpg differ diff --git a/host/figures/EBPF/ebpfrecord.jpg b/host/figures/EBPF/ebpfrecord.jpg new file mode 100644 index 0000000000000000000000000000000000000000..706f7b8271eb363eeb2c93cc2be677176a21b32e Binary files /dev/null and b/host/figures/EBPF/ebpfrecord.jpg differ diff --git a/host/figures/EBPF/ebpfsetting.jpg b/host/figures/EBPF/ebpfsetting.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e3f294f4274a2f97580eee974791434d42ecc4c1 Binary files /dev/null and b/host/figures/EBPF/ebpfsetting.jpg differ diff --git a/host/figures/EBPF/ebpfsummary.jpg b/host/figures/EBPF/ebpfsummary.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5f08df19a4ea33c2c872ec616e9b810f296aa908 Binary files /dev/null and b/host/figures/EBPF/ebpfsummary.jpg differ diff --git a/host/figures/EBPF/vmOptions.jpg b/host/figures/EBPF/vmOptions.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d6a38ba30aae5988f2c6c88ed784148a18515e8d Binary files /dev/null and b/host/figures/EBPF/vmOptions.jpg differ diff --git a/host/figures/EBPF/vmcounter.jpg b/host/figures/EBPF/vmcounter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cfe3852d8b39c2d432fed6cb90dffdb06c36d570 Binary files /dev/null and b/host/figures/EBPF/vmcounter.jpg differ diff --git a/host/figures/EBPF/vmdatamining.jpg b/host/figures/EBPF/vmdatamining.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4f732ce0053611e92124194095a89865df55e1e1 Binary files /dev/null and b/host/figures/EBPF/vmdatamining.jpg differ diff --git a/host/figures/EBPF/vmflame.jpg b/host/figures/EBPF/vmflame.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6cb5ddeb7f91adc8113281e5042df9ab4722c965 Binary files /dev/null and b/host/figures/EBPF/vmflame.jpg differ diff --git a/host/figures/EBPF/vmflamelevel.jpg b/host/figures/EBPF/vmflamelevel.jpg new file mode 100644 index 0000000000000000000000000000000000000000..37b9b4f64420deeca9f587483e8ff4efffa5dd0f Binary files /dev/null and b/host/figures/EBPF/vmflamelevel.jpg differ diff --git a/host/figures/EBPF/vmflameshow.jpg b/host/figures/EBPF/vmflameshow.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a9cef6d91b3affcc951cbe090c5476e7c364aa6a Binary files /dev/null and b/host/figures/EBPF/vmflameshow.jpg differ diff --git a/host/figures/EBPF/vmheaviesttrace.jpg b/host/figures/EBPF/vmheaviesttrace.jpg new file mode 100644 index 0000000000000000000000000000000000000000..686e2cea8757ab625739bf0248634f8b443c8e90 Binary files /dev/null and b/host/figures/EBPF/vmheaviesttrace.jpg differ diff --git a/host/figures/EBPF/vminputfilter.jpg b/host/figures/EBPF/vminputfilter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a72512b81d455b732e61e4f551b1c68c11bc1020 Binary files /dev/null and b/host/figures/EBPF/vminputfilter.jpg differ diff --git a/host/figures/EBPF/vmstatistics.jpg b/host/figures/EBPF/vmstatistics.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e316dd2623fd8dccf61f956a9006ba8768ef8253 Binary files /dev/null and b/host/figures/EBPF/vmstatistics.jpg differ diff --git a/host/figures/FileSystem/FileSystemCalltree.jpg b/host/figures/FileSystem/FileSystemCalltree.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6e7e2de008c1e5d6b670e9d6109292fc1a21e10e Binary files /dev/null and b/host/figures/FileSystem/FileSystemCalltree.jpg differ diff --git a/host/figures/FileSystem/FileSystemOptions.jpg b/host/figures/FileSystem/FileSystemOptions.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b5ce7a6a6816502550c40d7e5237a8bd088233d0 Binary files /dev/null and b/host/figures/FileSystem/FileSystemOptions.jpg differ diff --git a/host/figures/FileSystem/FileSystemchart.jpg b/host/figures/FileSystem/FileSystemchart.jpg new file mode 100644 index 0000000000000000000000000000000000000000..77ee172cf174350a55027c91ccc8f76b06596ad5 Binary files /dev/null and b/host/figures/FileSystem/FileSystemchart.jpg differ diff --git a/host/figures/FileSystem/FileSystemcommand.jpg b/host/figures/FileSystem/FileSystemcommand.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4f8a671ee41b3205c84ae4d932f3e10a72edd888 Binary files /dev/null and b/host/figures/FileSystem/FileSystemcommand.jpg differ diff --git a/host/figures/FileSystem/FileSystemcount.jpg b/host/figures/FileSystem/FileSystemcount.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6c049c9b564b301f5b28820bf748dc9831a29bb7 Binary files /dev/null and b/host/figures/FileSystem/FileSystemcount.jpg differ diff --git a/host/figures/FileSystem/FileSystemdatamining.jpg b/host/figures/FileSystem/FileSystemdatamining.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dbcd816b0ac0db534f97f05d263e8aca4db12019 Binary files /dev/null and b/host/figures/FileSystem/FileSystemdatamining.jpg differ diff --git a/host/figures/FileSystem/FileSystemevents.jpg b/host/figures/FileSystem/FileSystemevents.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5914209c0352e4cb950f361af79fa2395fe9508f Binary files /dev/null and b/host/figures/FileSystem/FileSystemevents.jpg differ diff --git a/host/figures/FileSystem/FileSystemexcutecommand.jpg b/host/figures/FileSystem/FileSystemexcutecommand.jpg new file mode 100644 index 0000000000000000000000000000000000000000..abd178fdab114642fcde657a497dc97a3f0804ec Binary files /dev/null and b/host/figures/FileSystem/FileSystemexcutecommand.jpg differ diff --git a/host/figures/FileSystem/FileSystemfile.jpg b/host/figures/FileSystem/FileSystemfile.jpg new file mode 100644 index 0000000000000000000000000000000000000000..536595781f01a39a41079c141439e0989bd6ca3b Binary files /dev/null and b/host/figures/FileSystem/FileSystemfile.jpg differ diff --git a/host/figures/FileSystem/FileSystemflame.jpg b/host/figures/FileSystem/FileSystemflame.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d644c143e7a782d2a7e03708a589c2bc701d92d5 Binary files /dev/null and b/host/figures/FileSystem/FileSystemflame.jpg differ diff --git a/host/figures/FileSystem/FileSystemflamelevel.jpg b/host/figures/FileSystem/FileSystemflamelevel.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2cff0eeb107da9e4155944eca57590011ed8b34e Binary files /dev/null and b/host/figures/FileSystem/FileSystemflamelevel.jpg differ diff --git a/host/figures/FileSystem/FileSystemflameshow.jpg b/host/figures/FileSystem/FileSystemflameshow.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b03f7b31ca17606e26768406a0effab4a3ec5cee Binary files /dev/null and b/host/figures/FileSystem/FileSystemflameshow.jpg differ diff --git a/host/figures/FileSystem/FileSystemheaviesttrace.jpg b/host/figures/FileSystem/FileSystemheaviesttrace.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2644870c90be8fcaa7a8ecc370a35faacdee2534 Binary files /dev/null and b/host/figures/FileSystem/FileSystemheaviesttrace.jpg differ diff --git a/host/figures/FileSystem/FileSystemhistory.jpg b/host/figures/FileSystem/FileSystemhistory.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2cf792ddc44796d32114a4be2c4463c192a74b3e Binary files /dev/null and b/host/figures/FileSystem/FileSystemhistory.jpg differ diff --git a/host/figures/FileSystem/FileSysteminputfilter.jpg b/host/figures/FileSystem/FileSysteminputfilter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ec0965db18378980c4f63be7a812a19ded10aaa9 Binary files /dev/null and b/host/figures/FileSystem/FileSysteminputfilter.jpg differ diff --git a/host/figures/FileSystem/FileSystemsamplecounter.jpg b/host/figures/FileSystem/FileSystemsamplecounter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..666200868fce4b88495e1f3a95741ee84cf11ade Binary files /dev/null and b/host/figures/FileSystem/FileSystemsamplecounter.jpg differ diff --git a/host/figures/FileSystem/FileSystemstatistics.jpg b/host/figures/FileSystem/FileSystemstatistics.jpg new file mode 100644 index 0000000000000000000000000000000000000000..86e2838c35e8c44dd740ce0c3847ab8aea873bac Binary files /dev/null and b/host/figures/FileSystem/FileSystemstatistics.jpg differ diff --git a/host/figures/FileSystem/FileSystemsummary.jpg b/host/figures/FileSystem/FileSystemsummary.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b2e201cc6dca939ff309c5aca740bca190c07dd0 Binary files /dev/null and b/host/figures/FileSystem/FileSystemsummary.jpg differ diff --git a/host/figures/FileSystem/FileSystemtimeslice.jpg b/host/figures/FileSystem/FileSystemtimeslice.jpg new file mode 100644 index 0000000000000000000000000000000000000000..570ada550e41b1850a01c55cc51444f2be922b2c Binary files /dev/null and b/host/figures/FileSystem/FileSystemtimeslice.jpg differ diff --git a/host/figures/FileSystem/filesystemfilter.jpg b/host/figures/FileSystem/filesystemfilter.jpg new file mode 100644 index 0000000000000000000000000000000000000000..39bffd42a0f6c667ad1aad05ee27b31c2782fa9b Binary files /dev/null and b/host/figures/FileSystem/filesystemfilter.jpg differ diff --git a/host/figures/FileSystem/filesystemrecord.jpg b/host/figures/FileSystem/filesystemrecord.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f6130bb8c8c222bbd58b40d8a562575c07e1270e Binary files /dev/null and b/host/figures/FileSystem/filesystemrecord.jpg differ diff --git a/host/figures/FileSystem/filesystemsetting.jpg b/host/figures/FileSystem/filesystemsetting.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3c5e3cee77c95c51159905045c6a2dd9a290e2d9 Binary files /dev/null and b/host/figures/FileSystem/filesystemsetting.jpg differ diff --git a/host/figures/HiSystemEvent/hisyseventPowerBattery.jpg b/host/figures/HiSystemEvent/hisyseventPowerBattery.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b38ed1956188e99d96eaa35c414ba04d66ebd843 Binary files /dev/null and b/host/figures/HiSystemEvent/hisyseventPowerBattery.jpg differ diff --git a/host/figures/HiSystemEvent/hisyseventPowerdetails.jpg b/host/figures/HiSystemEvent/hisyseventPowerdetails.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ce1e9af717655d732a90fe086f04a9734e1e7cbf Binary files /dev/null and b/host/figures/HiSystemEvent/hisyseventPowerdetails.jpg differ diff --git a/host/figures/HiSystemEvent/hisyseventsetting.jpg b/host/figures/HiSystemEvent/hisyseventsetting.jpg new file mode 100644 index 0000000000000000000000000000000000000000..20d75c8776e91be32f5013cbcb27085d2995b3b2 Binary files /dev/null and b/host/figures/HiSystemEvent/hisyseventsetting.jpg differ diff --git a/host/figures/HiSystemEvent/hisystemcommand.jpg b/host/figures/HiSystemEvent/hisystemcommand.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a213fb514968fc44ec993d6af4c5a15712d59141 Binary files /dev/null and b/host/figures/HiSystemEvent/hisystemcommand.jpg differ diff --git a/host/figures/HiSystemEvent/hisystemdetails.jpg b/host/figures/HiSystemEvent/hisystemdetails.jpg new file mode 100644 index 0000000000000000000000000000000000000000..92e88f53834cf64559ad1841ac7f797574e5b114 Binary files /dev/null and b/host/figures/HiSystemEvent/hisystemdetails.jpg differ diff --git a/host/figures/HiSystemEvent/hisystemeventemexcutecommand.jpg b/host/figures/HiSystemEvent/hisystemeventemexcutecommand.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ecbb7e70783c4d22be242e45bfb881ac45b75dba Binary files /dev/null and b/host/figures/HiSystemEvent/hisystemeventemexcutecommand.jpg differ diff --git a/host/figures/HiSystemEvent/hisystemeventfile.jpg b/host/figures/HiSystemEvent/hisystemeventfile.jpg new file mode 100644 index 0000000000000000000000000000000000000000..df88e858a69ecf2e4a9a9f3f85bd8c71c0f750a3 Binary files /dev/null and b/host/figures/HiSystemEvent/hisystemeventfile.jpg differ diff --git a/host/figures/HiSystemEvent/hisystemeventrecord.jpg b/host/figures/HiSystemEvent/hisystemeventrecord.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8ef5587d40bf09e2325f5d696cd9761380ca21e5 Binary files /dev/null and b/host/figures/HiSystemEvent/hisystemeventrecord.jpg differ diff --git a/host/figures/HiSystemEvent/hisystemeventsummary.jpg b/host/figures/HiSystemEvent/hisystemeventsummary.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ce9654a92bd2e8564023b4fdeea4c711ec3e976c Binary files /dev/null and b/host/figures/HiSystemEvent/hisystemeventsummary.jpg differ diff --git a/host/figures/HiSystemEvent/systemselectdetals.jpg b/host/figures/HiSystemEvent/systemselectdetals.jpg new file mode 100644 index 0000000000000000000000000000000000000000..65fee85ce45ea6ebcfbd57bdd2e2b5001ad73365 Binary files /dev/null and b/host/figures/HiSystemEvent/systemselectdetals.jpg differ diff --git a/host/figures/Metrics/Sql.jpg b/host/figures/Metrics/Sql.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ecbea173d79c563dcd104e77b08cc1b7863ca214 Binary files /dev/null and b/host/figures/Metrics/Sql.jpg differ diff --git a/host/figures/Metrics/download.jpg b/host/figures/Metrics/download.jpg new file mode 100644 index 0000000000000000000000000000000000000000..227a292968d3ddefe6ac0252a620ec36e179d2cd Binary files /dev/null and b/host/figures/Metrics/download.jpg differ diff --git a/host/figures/Metrics/infoandstats.jpg b/host/figures/Metrics/infoandstats.jpg new file mode 100644 index 0000000000000000000000000000000000000000..79d8be3e5c48ff7070d45a99b7875390ce6edbd5 Binary files /dev/null and b/host/figures/Metrics/infoandstats.jpg differ diff --git a/host/figures/Metrics/metrics.jpg b/host/figures/Metrics/metrics.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d00a8999fe7c9790bf9e3d4c55ee6d05bd3f7568 Binary files /dev/null and b/host/figures/Metrics/metrics.jpg differ diff --git a/host/figures/Scheduling.jpg b/host/figures/Scheduling.jpg deleted file mode 100644 index f7c5dd57bfcb038656d0fbe80cc7e685701ae479..0000000000000000000000000000000000000000 Binary files a/host/figures/Scheduling.jpg and /dev/null differ diff --git a/host/figures/Web/M.jpg b/host/figures/Web/M.jpg new file mode 100644 index 0000000000000000000000000000000000000000..574188a550e2fd585d5f596ac7076c9adc31fcf9 Binary files /dev/null and b/host/figures/Web/M.jpg differ diff --git a/host/figures/Web/StatesList.jpg b/host/figures/Web/StatesList.jpg new file mode 100644 index 0000000000000000000000000000000000000000..511000076ca1034ef6f286182d6d1ee8b529070f Binary files /dev/null and b/host/figures/Web/StatesList.jpg differ diff --git a/host/figures/Web/Switchlist.jpg b/host/figures/Web/Switchlist.jpg new file mode 100644 index 0000000000000000000000000000000000000000..75e572346234b744ecb48286b896558c1635111c Binary files /dev/null and b/host/figures/Web/Switchlist.jpg differ diff --git a/host/figures/callstackclick.jpg b/host/figures/Web/callstackclick.jpg similarity index 100% rename from host/figures/callstackclick.jpg rename to host/figures/Web/callstackclick.jpg diff --git a/host/figures/callstackselect.jpg b/host/figures/Web/callstackselect.jpg similarity index 100% rename from host/figures/callstackselect.jpg rename to host/figures/Web/callstackselect.jpg diff --git a/host/figures/Web/checkbox.jpg b/host/figures/Web/checkbox.jpg new file mode 100644 index 0000000000000000000000000000000000000000..acbc9a40be5c054184bcbff8dba257b9d277e51d Binary files /dev/null and b/host/figures/Web/checkbox.jpg differ diff --git a/host/figures/cpu.jpg b/host/figures/Web/cpu.jpg similarity index 100% rename from host/figures/cpu.jpg rename to host/figures/Web/cpu.jpg diff --git a/host/figures/Web/cpubyprocess.jpg b/host/figures/Web/cpubyprocess.jpg new file mode 100644 index 0000000000000000000000000000000000000000..470d4f3fdf5119773bc7b180d880a962d495b19d Binary files /dev/null and b/host/figures/Web/cpubyprocess.jpg differ diff --git a/host/figures/Web/cpubythread.jpg b/host/figures/Web/cpubythread.jpg new file mode 100644 index 0000000000000000000000000000000000000000..99c06e9d6fc87e390f33297623f519dc8fc37189 Binary files /dev/null and b/host/figures/Web/cpubythread.jpg differ diff --git a/host/figures/cpuclick.jpg b/host/figures/Web/cpuclick.jpg similarity index 100% rename from host/figures/cpuclick.jpg rename to host/figures/Web/cpuclick.jpg diff --git a/host/figures/Web/cpusage.jpg b/host/figures/Web/cpusage.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ecb696bb7f4bc7212999941c208daef0ff5abab5 Binary files /dev/null and b/host/figures/Web/cpusage.jpg differ diff --git a/host/figures/Web/details.jpg b/host/figures/Web/details.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9d9faf9dac54e6ec29953be33def7250e0eaa44b Binary files /dev/null and b/host/figures/Web/details.jpg differ diff --git a/host/figures/Web/flag.jpg b/host/figures/Web/flag.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8720740c3256c2b64be4411809d9fa87d1ba0100 Binary files /dev/null and b/host/figures/Web/flag.jpg differ diff --git a/host/figures/Web/flaginput.jpg b/host/figures/Web/flaginput.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bc0b554ebb7569a2c65424c1025c7115b3f1c77d Binary files /dev/null and b/host/figures/Web/flaginput.jpg differ diff --git a/host/figures/fps.jpg b/host/figures/Web/fps.jpg similarity index 100% rename from host/figures/fps.jpg rename to host/figures/Web/fps.jpg diff --git a/host/figures/fpsselect.jpg b/host/figures/Web/fpsselect.jpg similarity index 100% rename from host/figures/fpsselect.jpg rename to host/figures/Web/fpsselect.jpg diff --git a/host/figures/Web/fpstip.jpg b/host/figures/Web/fpstip.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7b5954226117c9ffd08fb2a974214006180a8160 Binary files /dev/null and b/host/figures/Web/fpstip.jpg differ diff --git a/host/figures/gray.jpg b/host/figures/Web/gray.jpg similarity index 100% rename from host/figures/gray.jpg rename to host/figures/Web/gray.jpg diff --git a/host/figures/highlit.jpg b/host/figures/Web/highlit.jpg similarity index 100% rename from host/figures/highlit.jpg rename to host/figures/Web/highlit.jpg diff --git a/host/figures/Web/jumpthread.jpg b/host/figures/Web/jumpthread.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bdb494ed810dab30cfd998718c08d6b891dd09db Binary files /dev/null and b/host/figures/Web/jumpthread.jpg differ diff --git a/host/figures/main.jpg b/host/figures/Web/main.jpg similarity index 100% rename from host/figures/main.jpg rename to host/figures/Web/main.jpg diff --git a/host/figures/Web/opentrace.jpg b/host/figures/Web/opentrace.jpg new file mode 100644 index 0000000000000000000000000000000000000000..249bfb1c244ebdf79e7afa0e5d63435313487156 Binary files /dev/null and b/host/figures/Web/opentrace.jpg differ diff --git a/host/figures/process.jpg b/host/figures/Web/process.jpg similarity index 100% rename from host/figures/process.jpg rename to host/figures/Web/process.jpg diff --git a/host/figures/Web/search.jpg b/host/figures/Web/search.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9e5900ec03c7cc688c2f150775db3a0b11028e71 Binary files /dev/null and b/host/figures/Web/search.jpg differ diff --git a/host/figures/Web/searchcallstack.jpg b/host/figures/Web/searchcallstack.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2dbd4cf5a838980b641df9a4e9c2871fd73034d8 Binary files /dev/null and b/host/figures/Web/searchcallstack.jpg differ diff --git a/host/figures/Web/stars.jpg b/host/figures/Web/stars.jpg new file mode 100644 index 0000000000000000000000000000000000000000..62a3492126d240e8080f4be976abe0eb2d99315d Binary files /dev/null and b/host/figures/Web/stars.jpg differ diff --git a/host/figures/threadclick.jpg b/host/figures/Web/threadclick.jpg similarity index 100% rename from host/figures/threadclick.jpg rename to host/figures/Web/threadclick.jpg diff --git a/host/figures/threadinfo.jpg b/host/figures/Web/threadinfo.jpg similarity index 100% rename from host/figures/threadinfo.jpg rename to host/figures/Web/threadinfo.jpg diff --git a/host/figures/threadselect.jpg b/host/figures/Web/threadselect.jpg similarity index 100% rename from host/figures/threadselect.jpg rename to host/figures/Web/threadselect.jpg diff --git a/host/figures/Web/threadstates.jpg b/host/figures/Web/threadstates.jpg new file mode 100644 index 0000000000000000000000000000000000000000..475dde7276e119266eb76d2ab0f3d4eaa45d9df1 Binary files /dev/null and b/host/figures/Web/threadstates.jpg differ diff --git a/host/figures/Web/threadswitches.jpg b/host/figures/Web/threadswitches.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cc5974681992956657428d63cb8fbf8b8e01bd1c Binary files /dev/null and b/host/figures/Web/threadswitches.jpg differ diff --git a/host/figures/time.jpg b/host/figures/Web/time.jpg similarity index 100% rename from host/figures/time.jpg rename to host/figures/Web/time.jpg diff --git a/host/figures/Web/trace.jpg b/host/figures/Web/trace.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3975199b39ee1cc2187358fef66932eea4b1c1b2 Binary files /dev/null and b/host/figures/Web/trace.jpg differ diff --git a/host/figures/command.jpg b/host/figures/command.jpg deleted file mode 100644 index 553077d0f5dcea3276b090162992f95f650cae1c..0000000000000000000000000000000000000000 Binary files a/host/figures/command.jpg and /dev/null differ diff --git a/host/figures/cpu_frequency.png b/host/figures/cpu_frequency.png deleted file mode 100644 index a18715fc696b3231b94425e4acd6aaf319bf399f..0000000000000000000000000000000000000000 Binary files a/host/figures/cpu_frequency.png and /dev/null differ diff --git a/host/figures/cpubyprocess.jpg b/host/figures/cpubyprocess.jpg deleted file mode 100644 index 180597dcbe73e1dba3ce58f348ca5b71da9077bd..0000000000000000000000000000000000000000 Binary files a/host/figures/cpubyprocess.jpg and /dev/null differ diff --git a/host/figures/cpubythread.jpg b/host/figures/cpubythread.jpg deleted file mode 100644 index 0ada58ba849f9b2c5dcfa83c44fdda94ab696879..0000000000000000000000000000000000000000 Binary files a/host/figures/cpubythread.jpg and /dev/null differ diff --git a/host/figures/cpusage.jpg b/host/figures/cpusage.jpg deleted file mode 100644 index 0aba4c0ee62c02bc846ab17d3f2cdb244dbe66d2..0000000000000000000000000000000000000000 Binary files a/host/figures/cpusage.jpg and /dev/null differ diff --git a/host/figures/deploy/bin_files.png b/host/figures/deploy/bin_files.png new file mode 100644 index 0000000000000000000000000000000000000000..6657337dce8d72b262e1c02473098f5be59aa33c Binary files /dev/null and b/host/figures/deploy/bin_files.png differ diff --git a/host/figures/deploy/check_version.png b/host/figures/deploy/check_version.png new file mode 100644 index 0000000000000000000000000000000000000000..1b33a994141c82e4dc574aa1d1f774aa8d4fdc28 Binary files /dev/null and b/host/figures/deploy/check_version.png differ diff --git a/host/figures/deploy/chomd+x.png b/host/figures/deploy/chomd+x.png new file mode 100644 index 0000000000000000000000000000000000000000..e2781fc8e4fe005376d85b18ca220a5c6ef8a5e5 Binary files /dev/null and b/host/figures/deploy/chomd+x.png differ diff --git a/host/figures/deploy/compile.png b/host/figures/deploy/compile.png new file mode 100644 index 0000000000000000000000000000000000000000..1221e25c0b69e87feaeddf767334620716fe4726 Binary files /dev/null and b/host/figures/deploy/compile.png differ diff --git a/host/figures/deploy/install_golang.png b/host/figures/deploy/install_golang.png new file mode 100644 index 0000000000000000000000000000000000000000..a4a58e9fa7e5f4ede6d96b6a2727f1385292c28c Binary files /dev/null and b/host/figures/deploy/install_golang.png differ diff --git a/host/figures/deploy/install_node.png b/host/figures/deploy/install_node.png new file mode 100644 index 0000000000000000000000000000000000000000..14f15af1343948d39098f2f75c7cd64dd2c0b412 Binary files /dev/null and b/host/figures/deploy/install_node.png differ diff --git a/host/figures/deploy/install_tsc.png b/host/figures/deploy/install_tsc.png new file mode 100644 index 0000000000000000000000000000000000000000..5ea36c6a86b8459d0ca34ddc4c20bbd651828a3a Binary files /dev/null and b/host/figures/deploy/install_tsc.png differ diff --git a/host/figures/deploy/put_bin.png b/host/figures/deploy/put_bin.png new file mode 100644 index 0000000000000000000000000000000000000000..7945c95d265437d89924d8d19072f643f7b19b62 Binary files /dev/null and b/host/figures/deploy/put_bin.png differ diff --git a/host/figures/deploy/run_main.png b/host/figures/deploy/run_main.png new file mode 100644 index 0000000000000000000000000000000000000000..c074ce6b113a0a41a80b7bd609781b02ee18fcd9 Binary files /dev/null and b/host/figures/deploy/run_main.png differ diff --git a/host/figures/deploy/third_party.png b/host/figures/deploy/third_party.png new file mode 100644 index 0000000000000000000000000000000000000000..77ff8ca912ee369c1f8407ce511e4e17de16c579 Binary files /dev/null and b/host/figures/deploy/third_party.png differ diff --git a/host/figures/deploy/visit_website.png b/host/figures/deploy/visit_website.png new file mode 100644 index 0000000000000000000000000000000000000000..5cdfb90a1f3c71316fdec9f0d6a78e18cd90851e Binary files /dev/null and b/host/figures/deploy/visit_website.png differ diff --git a/host/figures/deploy/yum_install_go.png b/host/figures/deploy/yum_install_go.png new file mode 100644 index 0000000000000000000000000000000000000000..4eae4fabc664f521db101288c8491e10b4013870 Binary files /dev/null and b/host/figures/deploy/yum_install_go.png differ diff --git a/host/figures/deploy/yum_install_node.png b/host/figures/deploy/yum_install_node.png new file mode 100644 index 0000000000000000000000000000000000000000..b05160f060bec9bd90d951626af88ba6b3fda63b Binary files /dev/null and b/host/figures/deploy/yum_install_node.png differ diff --git a/host/figures/dump_and_mem.png b/host/figures/dump_and_mem.png deleted file mode 100644 index b7e3cc26ca286702c9ca9869fc203aff34a8da39..0000000000000000000000000000000000000000 Binary files a/host/figures/dump_and_mem.png and /dev/null differ diff --git a/host/figures/excutecommand.jpg b/host/figures/excutecommand.jpg deleted file mode 100644 index 08335f77d94cb19252bb4cee92944339b8bab64c..0000000000000000000000000000000000000000 Binary files a/host/figures/excutecommand.jpg and /dev/null differ diff --git a/host/figures/filters.png b/host/figures/filters.png deleted file mode 100644 index a02d9416f08382ff7a03e176e37e6479f5922c08..0000000000000000000000000000000000000000 Binary files a/host/figures/filters.png and /dev/null differ diff --git a/host/figures/hdc/Device.jpg b/host/figures/hdc/Device.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fbb598d131fdedd5584ef9ab42194ffb50d57dfb Binary files /dev/null and b/host/figures/hdc/Device.jpg differ diff --git a/host/figures/hdc/Schedulingdetails.jpg b/host/figures/hdc/Schedulingdetails.jpg new file mode 100644 index 0000000000000000000000000000000000000000..78d9982358133090369cf40e13d11be62622173f Binary files /dev/null and b/host/figures/hdc/Schedulingdetails.jpg differ diff --git a/host/figures/hdc/examplerecord.jpg b/host/figures/hdc/examplerecord.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a3c3ca0a2e4db30149365d7d89f1cf886a0c8d35 Binary files /dev/null and b/host/figures/hdc/examplerecord.jpg differ diff --git a/host/figures/hdc/hdc.jpg b/host/figures/hdc/hdc.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bf8c0e8bfd2ac208214203dd972f3b3821b06d5d Binary files /dev/null and b/host/figures/hdc/hdc.jpg differ diff --git a/host/figures/hdc/hdcfile.jpg b/host/figures/hdc/hdcfile.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d5d56f9abdab6f8ce697daaf82a8c0449f909c82 Binary files /dev/null and b/host/figures/hdc/hdcfile.jpg differ diff --git a/host/figures/hdc/hdctracing.jpg b/host/figures/hdc/hdctracing.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b24d5676213df9dba062bb2be7998296fca28562 Binary files /dev/null and b/host/figures/hdc/hdctracing.jpg differ diff --git a/host/figures/hdc/record.jpg b/host/figures/hdc/record.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bf472ca30f4f8cb33038316f35be692e05eee34d Binary files /dev/null and b/host/figures/hdc/record.jpg differ diff --git a/host/figures/htrace.jpg b/host/figures/htrace.jpg deleted file mode 100644 index 0c3999d31b19b03d6c2471ff80cbcd4d2e7e2177..0000000000000000000000000000000000000000 Binary files a/host/figures/htrace.jpg and /dev/null differ diff --git a/host/figures/log.png b/host/figures/log.png deleted file mode 100644 index dbe3780eb647493dec252d69f23e71cf66ac15a8..0000000000000000000000000000000000000000 Binary files a/host/figures/log.png and /dev/null differ diff --git a/host/figures/mem_usage.png b/host/figures/mem_usage.png deleted file mode 100644 index f4ebd6e272c424d6861e2e8150c72c1f4de9802a..0000000000000000000000000000000000000000 Binary files a/host/figures/mem_usage.png and /dev/null differ diff --git a/host/figures/opentrace.jpg b/host/figures/opentrace.jpg deleted file mode 100644 index c2fcf84c6dea67205d5cd5b6041dad1834631d33..0000000000000000000000000000000000000000 Binary files a/host/figures/opentrace.jpg and /dev/null differ diff --git a/host/figures/process_thread.png b/host/figures/process_thread.png deleted file mode 100644 index abc3867130c10413197482d0156ce0ee00aca255..0000000000000000000000000000000000000000 Binary files a/host/figures/process_thread.png and /dev/null differ diff --git a/host/figures/smaps/smapschart.jpg b/host/figures/smaps/smapschart.jpg new file mode 100644 index 0000000000000000000000000000000000000000..032d543261f85121367fa3f7e260e688b018d815 Binary files /dev/null and b/host/figures/smaps/smapschart.jpg differ diff --git a/host/figures/smaps/smapsexcuting.jpg b/host/figures/smaps/smapsexcuting.jpg new file mode 100644 index 0000000000000000000000000000000000000000..53f86e1472c53801d7d3637ffadae6d493233921 Binary files /dev/null and b/host/figures/smaps/smapsexcuting.jpg differ diff --git a/host/figures/smaps/smapslist.jpg b/host/figures/smaps/smapslist.jpg new file mode 100644 index 0000000000000000000000000000000000000000..598f6a1289980ead2857757d8d7ff513d5a022d9 Binary files /dev/null and b/host/figures/smaps/smapslist.jpg differ diff --git a/host/figures/smaps/smapsrecord.jpg b/host/figures/smaps/smapsrecord.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9380722264bf06e22a1b1231e97eca0f06a0db1f Binary files /dev/null and b/host/figures/smaps/smapsrecord.jpg differ diff --git a/host/figures/smaps/smapssetting.jpg b/host/figures/smaps/smapssetting.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d6d23c4133e2a33662913c931485f0fe2d4fb143 Binary files /dev/null and b/host/figures/smaps/smapssetting.jpg differ diff --git a/host/figures/smaps/smapsstatistics.jpg b/host/figures/smaps/smapsstatistics.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4af1ef5ad619eeb8a0ed024286c868421118c428 Binary files /dev/null and b/host/figures/smaps/smapsstatistics.jpg differ diff --git a/host/figures/smaps/smapssummary.jpg b/host/figures/smaps/smapssummary.jpg new file mode 100644 index 0000000000000000000000000000000000000000..df74018bc3bdfd6bec26d540415e2125e929530a Binary files /dev/null and b/host/figures/smaps/smapssummary.jpg differ diff --git a/host/figures/smartperf_framework.png b/host/figures/smartperf_framework.png deleted file mode 100644 index 62c1bc6cd61e07ba3014141f70941e6134d75681..0000000000000000000000000000000000000000 Binary files a/host/figures/smartperf_framework.png and /dev/null differ diff --git a/host/figures/systraceconfig.jpg b/host/figures/systraceconfig.jpg deleted file mode 100644 index 5436850abf26aaea585049af1908c85d1ce67178..0000000000000000000000000000000000000000 Binary files a/host/figures/systraceconfig.jpg and /dev/null differ diff --git a/host/figures/thread_state.png b/host/figures/thread_state.png deleted file mode 100644 index 186ffb16905c7cfa0178f7c14a0189223f6c9e22..0000000000000000000000000000000000000000 Binary files a/host/figures/thread_state.png and /dev/null differ diff --git a/host/figures/trace.jpg b/host/figures/trace.jpg deleted file mode 100644 index 378dba3e866095c0b1155175d09eeb615b3dbf9a..0000000000000000000000000000000000000000 Binary files a/host/figures/trace.jpg and /dev/null differ diff --git a/host/figures/trace_streamer_stream.png b/host/figures/trace_streamer_stream.png deleted file mode 100644 index d36687d164a32bcb07f8f8bd699f0fb0b37e63bd..0000000000000000000000000000000000000000 Binary files a/host/figures/trace_streamer_stream.png and /dev/null differ