HarmonyOS developtools_hiperf编译相关问题

咨询描述:

该项目git地址:

https://gitee.com/openharmony/developtools_hiperf

为c++源码,阅读项目下readme.md文档,了解到需要编译生成各平台下二进制文件,才可通过script目录下package.sh脚本打包生成python项目工具包,目前不知道如何编译该项目。

自行搜索安装编译相关工具ninja和gn。

1. 尝试执行gn编译命令:gn gen out/,编译报错如下:

➜ developtools_hiperf git:(master) ✗ gn gen out/
ERROR Can't find source root. 
I could not find a ".gn" file in the current directory or any parent, 
and the --root command-line argument was not specified.
  • 1.
  • 2.
  • 3.
  • 4.

2. 根据报错提示,自行在项目根目录下添加".gn"文件,并编辑内容如下:

➜ developtools_hiperf git:(master) ✗ cat .gn
buildconfig = "//BUILD.gn"
  • 1.
  • 2.

3. 重新执行gn编译命令:gn gen out/,编译报错如下:

➜ developtools_hiperf git:(master) ✗ gn gen out/
ERROR at //BUILD.gn:14:1: Unable to load "/Users/xxx/WorkDirectory/code/gitee/developtools_hiperf/build/ohos.gni". 
import("//build/ohos.gni")
  • 1.
  • 2.
  • 3.
HarmonyOS
2024-08-23 12:34:18
956浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
superinsect

开发者Hiperf工具是不需要自己编译的,工具已经内置到HarmonyOS中, 只需要使用hdc命令连接进入即可,常用操作步骤命令如下,详细可以查看gitee文档具体描述(如果不需要生成火焰图的话是不需要安装python的)

hdc shell 进入设备 
cd /data/local/tmp/ 进入目录,报告文件都在此目录 
hiperf --help 使用help命令可以查看hiperf的命令解释 
hiperf record --help 查看record help信息 
hiperf report --help 查看report help信息 
hiperf record -a -d 10 -f 2000 -s dwarf record采集 -a整机所有进程 -d时间 -f频率 -s dwarf采样方式 
hiperf record -p pid -d 10 -f 2000 -s dwarf -p采集指定某个进程 
hiperf record --app com.huawei.xx -d 10 -f 2000 -s dwarf -app 进程名 
hiperf report 生成报告,可以使用json保存存储 
hiperf dump 解析,没有具体格式
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
分享
微博
QQ
微信
回复
2024-08-23 20:30:06


相关问题
编译的hvigor.js相关问题
1491浏览 • 1回复 待解决
HarmonyOS App编译打包相关
906浏览 • 1回复 待解决
HarmonyOS 编译问题
711浏览 • 1回复 待解决
HarmonyOS AccountKit相关问题
1233浏览 • 1回复 待解决
HarmonyOS 证书相关问题
1046浏览 • 1回复 待解决
HarmonyOS Grid相关问题
1267浏览 • 1回复 待解决
HarmonyOS Lib相关问题
702浏览 • 1回复 待解决
HarmonyOS KVStore 相关问题
1033浏览 • 1回复 待解决
HarmonyOS Worker相关问题
909浏览 • 1回复 待解决
HarmonyOS 线程相关问题
1327浏览 • 1回复 待解决
HarmonyOS string相关问题
938浏览 • 1回复 待解决
HarmonyOS BindSheet相关问题
1428浏览 • 1回复 待解决
HarmonyOS 编译失败问题
1289浏览 • 1回复 待解决
HarmonyOS 地图相关问题
1553浏览 • 1回复 待解决
HarmonyOS音频相关问题
1514浏览 • 1回复 待解决
适配HarmonyOS相关问题
980浏览 • 1回复 待解决
HarmonyOS CardRecognition相关问题
935浏览 • 1回复 待解决
HarmonyOS 混淆相关问题
791浏览 • 1回复 待解决
HarmonyOS RelativeContainer相关问题
732浏览 • 1回复 待解决
HarmonyOS PushExtensionAbility相关问题
838浏览 • 1回复 待解决
HarmonyOS protobuf相关问题
1286浏览 • 1回复 待解决
HarmonyOS @Event相关问题
918浏览 • 1回复 待解决
HarmonyOS RN相关问题
1407浏览 • 1回复 待解决
HarmonyOS ApplicationContext相关问题
1031浏览 • 1回复 待解决