缓存行对齐检查是对C/C++源码中结构体变量进行128字节对齐检查,提升访存性能。
对C/C++源码中结构体变量进行128字节对齐检查。
1 | devkit advisor cacheline [-h | --help] {-i INPUT_PATH | --input INPUT_PATH} [-o OUTPUT_PATH | --output OUTPUT_PATH] [-r {all,json,html,csv} | --report-type {all,json,html,csv}] [-l {0,1,2,3} | --log-level {0,1,2,3}] [--set-timeout TIMEOUT] |
参数 |
参数选项 |
参数说明 |
---|---|---|
-h/--help |
- |
获取帮助信息。 |
-i/--input |
input_path |
必选参数,待扫描的源码文件夹路径。 |
-o/--output |
output_path |
扫描报告的存放路径,默认存放在当前执行路径下,报告名称为模块名称_时间戳。 |
-r/--report-type |
all/json/html/csv |
扫描报告的格式,默认为all。
|
-l/--log-level |
0/1/2/3 |
设置日志级别,默认为1。
|
--set-timeout |
time |
任务超时时间,单位为分钟,若执行时间超过超时时间则退出执行。默认无超时时间,任务将持续执行直到结束。 |
以扫描“/home/test_code/vecanalyzer”路径下源码,扫描报告存放至“/home/out”路径为例,其余均采用默认值,请根据实际情况进行修改。
1 | devkit advisor cacheline -i /home/test_code/vecanalyzer -o /home/out/ |
返回信息如下,并输出报告。
Executing Cacheline Alignment Check task, please wait... Current progress: ################################# [100%] Scanned time: 2025/04/07 03:00:02 Configuration: Scan source code path: /home/test_code/vecanalyzer Generate report path: /home/out Generate report type: all Task Timeout Interval: The timeout period is not set. Log level: info Summary: Scanned 1 files, there are 1 recommended modifications. For the details information, please check: /home/out/cacheline_20250407030002_740e.json /home/out/cacheline_20250407030002_740e.csv /home/out/cacheline_20250407030002_740e.html
参数 |
说明 |
---|---|
配置信息 |
显示软件源码文件存放路径。 |
需要修改的源码文件 |
显示存在缓存行对齐问题,并需要进行修改的源码文件路径等相关信息。 |