CamX Memory Profile的使用

2025年02月02日 CamX Memory Profile的使用 极客笔记

本文总结在CamX上内存分析的一些调试技巧。

CamX中Memory Profile的使用

首先从 /vendor/etc/camera/ 下面 pull 出camxoverridesettings.txt

adb pull /vendor/etc/camera/camxoverridesettings.txt

在该文件中添加如下三行,前两行是打开offline log,最后两行是打开memory 统计功能。

enableOfflineDump=0x1
EnableAsciiLogging=0x1
logInfoMask=0x20
enableMemoryStats=TRUE

再将 camxoverridesettings.txt push到/vendor/etc/camera/,然后重启手机/重启provider进程。

复现问题后,抓出offline log并对其进行merge,具体的merge方法请参考:

接下来执行 get_memory_stats.py 产生memory profile report:

python get_memory_stats.py <output_file_name_without_extension> <output_sheet_name> <log_file1> <log_file1>

比如下面是我抓取两次拍照后的memory统计对比情况:

C:\Python27\python.exe .\get_memory_stats.py mc_capture capture .\0030.txt .\0002.txt

执行上面的语句后会产生两个文件:

  • capture.csv : 内存使用详细信息
  • mc_capture.xlsx: 两次memory 统计对比

mc_capture.xlsx 文件最后会有两次内存统计的比较数据:

本文链接:http://so.lmcjl.com/news/22541/

展开阅读全文