简介
hiperf 是 OpenHarmony 为开发人员提供的用于调试的命令行工具,用于抓取特定程序或者系统的性能数据,类似内核的 perf 工具,该工具支持在 Windows/Linux/Mac 等操作系统上运行。
架构

目录
/developtools/hiperf
├── demo # demo 程序
│ ├── cpp # C++ demo 程序,示范了如何调用API和模拟的采样场景
│ └── js # JS demo 程序,示范了如何调用API
├── include # 工程的头文件
│ └── nonlinux # 交叉编译的头文件(非linux平台)
├── interfaces # 接口忘记
│ ├── innerkits # C++ API 接口
│ └── kits # JS API 接口
├── proto # report 命令导出到proto的数据结构定义
├── script # Host 脚本,包括 HTML
│ └── test # 脚本的单元测试
├── src # 源代码文件夹
└── test # 源代码的单元测试
约束
运行环境条件约束如下
| 依赖组件 | 版本 |
|---|---|
| Python | 3.7.0 |
编译构建
基础配置
- 确保组件名在于产品形态配置的 json 中
- 产品形态配置
- 加入
"developtools:hiperf":{}即可
- 加入
- 产品形态配置
编译命令
| 编译说明 | 编译参数 |
|---|---|
| 只编译当前设备平台的二进制执行文件 | --build-target hiperf_target |
| 编译所有的平台的所有组件(包括单元测试) | --build-target hiperf_all |
| 编译目标为 x86_64 Linux 平台的工具 | --gn-args "hiperf_target_host=true" |
| 编译单元测试 | --build-target hiperf_unittest |
| 编译单元测试的接口部分(命令行部分) | --build-target hiperf_interfacetest |
编译输出
| 编译目标 | 运行平台 | 文件位置 | 文件名 |
|---|---|---|---|
| Dev 端命令行程序 | arm | out\ohos-arm-release\developtools\hiperf\hiperf | hiperf |
| linux | out\ohos-arm-release\clang_x64\developtools\hiperf | hiperf | |
| Host 端命令行程序 | linux | out\ohos-arm-release\clang_x64\developtools\hiperf | hiperf_host |
| windows | out\ohos-arm-release\mingw_x86_64\developtools\hiperf | hiperf_host.exe | |
| Host 端动态库 | linux | out\ohos-arm-release\clang_x64\developtools\hiperf | libhiperf_report.so |
| windows | out\ohos-arm-release\mingw_x86_64\developtools\hiperf | libhiperf_report.dll |

最低0.47元/天 解锁文章
1301

被折叠的 条评论
为什么被折叠?



