
回复
添加资源
添加资源将有机会获得更多曝光,你也可以直接关联已上传资源 去关联
@[toc](hiperf
代码位置 https://gitee.com/openharmony/developtools_hiperf
参数 | 功能说明 |
---|---|
–help [command] | 显示指定功能的帮助信息 |
–debug | 打开 DEBUG 级别的调试日志 |
–verbose | 打开 VERBOSE 级别的调试日志 |
–much | 打开 MUCH 级别的调试日志 |
–mixlog | 混合调试日志输出到屏幕上(stdout) |
–logtag <tagA [,tagB] [,tagC]> | 打开指定模块的MUCH级别的调试日志 |
–hilog | 日志打印到Hilog中 |
–logpath | 指定日志保存的路径 |
–nodebug | 停止打印任何日志 |
列出设备上支持的所有事件名称
事件名称用于 stat 和 record 的 -e 和 -g 参数
Usage: hiperf list [event type name]
下面列出了设备支持的HW事件,并且会提示哪些事件此设备不支持
./hiperf list hw
监听指定目标程序,周期性打印性能计数器的值
Usage: hiperf stat [options] [command [command-args]]
Collect performance counter information of running [command].
下面展示了一个 stats 监听本进程 在 CPU 0 上 3 秒的性能计数器命令
./hiperf stat -d 3 -c 0
采样指定目标程序,并且将采样数据保存到指定的文件中(默认为perf.data)
Usage: hiperf record [options] [command [command-args]]
Collect performance sampling information of running [command].
对全系统所有进程采样3秒,并且显示详细的信息
./hiperf record -d 3 -a --verbose
hiperf record -d 10 -a
默认生成perf.data文件路径:
/data/local/tmp
hdc file recv /data/local/tmp/perf.data %cd%
1>将lib库:
Z:\OpenHarmony\master\out\rk3568\mingw_x86_64\developtools\hiperf
libhiperf_report.dll
libhiperf_report.lib
拷贝到脚本recv_binary_cache.py的当前目录的bin\windows\x86_64目录下
2> 将hdc_std.exe文件添加到PATH路径下
3>板子连接电脑,hdc_std shell可以正常使用
4> perf.data文件在 recv_binary_cache.py脚本的目录下
5>收集perf.data 里面记录的相关文件和库的符号表
python recv_binary_cache.py -l Z:\OpenHarmony\master\out\rk3568\lib.unstripped Z:\OpenHarmony\master\out\rk3568\exe.unstripped
路径根据实际使用修改
产生HTML文件,默认的文件名是 hiperf_report.html
python make_report.py