简介
HiDumper是OpenHarmony中为开发、测试人员,IDE工具提供统一的系统信息获取工具,帮助使用者分析,定位问题。
HiDumper主要包括以下几个主要模块:
- hidumper:可执行程序,工具入口,在板上可通过hidumper执行对应命令
- hidumperclient:动态库,提供framework层接口
- lib_dump_usage:动态库,提供framework层功能实现
- hidumperservice:动态库,sa服务,提供service层功能实现
结构分析
.
├── BUILD.gn
├── bundle.json
├── client
│ └── native
│ ├── dump_client_main.cpp
│ └── main.cpp //可执行文件入口
├── figures
├── frameworks //框架实现
│ └── native
│ ├── BUILD.gn
│ ├── common.h
│ ├── dump_controller.h
│ ├── dump_utils.cpp
│ ├── dump_utils.h
│ ├── include
│ └── src
├── hidumper.gni
├── interfaces
│ ├── innerkits
│ │ ├── BUILD.gn
│ │ ├── dump_usage.cpp
│ │ └── include
│ └── native
│ └── innerkits
├── LICENSE
├── OAT.xml
├── README.md
├── README_zh.md
├── sa_profile
├── services //服务实现
│ ├── BUILD.gn
│ ├── hidumper.map
│ ├── native
│ │ ├── etc
│ │ ├── include
│ │ └── src
│ └── zidl
│ ├── include
│ └── src
├── test
└── utils
- usage
"usage:\n"
" -h |help text for the tool\n"
" -lc |a list of system information clusters\n"
" -ls |a list of system abilities\n"
" -c |all system information clusters\n"
" -c [base system] |system information clusters labeled \"base\" and \"system\"\n"
" -s |all system abilities\n"
" -s [SA0 SA1] |system abilities labeled \"SA0\" and \"SA1\"\n"
" -s [SA] -a ['-h'] |system ability labeled \"SA\" with arguments \"-h\" specified\n"
" -e |faultlogs of crash history\n"
" --net |dump network information\n"
" --storage |dump storage information\n"
" -p |processes information, include list and infromation of processes"
" and threads\n"
" -p [pid] |dump threads under pid, includes smap, block channel,"
" execute time, mountinfo\n"
" --cpuusage [pid] |dump cpu usage by processes and category; if PID is specified,"
" dump category usage of specified pid\n"
" --cpufreq |dump real CPU frequency of each core\n"
" --mem [pid] |dump memory usage of total; dump memory usage of specified"
" pid if pid was specified\n"
" --zip |compress output to /data/log/hidumper\n";
如上,我们可以看出hidumper能查看几乎OpenHarmony里内的所有信息,比如:
- 查看系统ability信息,其中也包括HiDumperService
# hidumper -ls
System ability list:
RenderService AbilityManagerService DataObserverMgr
UriPermissionMgr AccountMgr BundleMgr
FormMgr ApplicationManagerService Installd
AccessibilityManagerService UserIdmService