内存一致性检查就是检查源码迁移在鲲鹏平台运行时可能存在的内存一致性问题,并提供插入内存屏障的建议。
检查源码中存在的内存一致性问题。
1 | devkit advisor mm-check [-h | --help] {-i INPUT_PATH | --input INPUT_PATH}{-f BC_PATH | --bc-file BC_PATH} [--autofix {true,false}] [--autofix-dir AUTOFIX_OUTPUT_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 |
必选参数,BC文件对应的源码文件夹路径。 |
-f/--bc-file |
path |
必选参数,BC文件夹路径,该路径下必须存在BC文件。 |
--autofix |
true/false |
是否生成编译器配置文件,默认为false。 |
--autofix-dir |
path |
编译器配置文件的存放地址。默认生成在工具目录下的源码文件夹下,使用--autofix且参数必须为true时才能生效。 |
-o/--output |
output_path |
扫描报告的存放路径,默认存放在当前执行路径下,报告名称为模块名称_时间戳。 |
--set-timeout |
time |
任务超时时间,单位为分钟,若执行时间超过超时时间则退出执行。默认无超时时间,任务将持续执行直到结束。 |
-l/--log-level |
0/1/2/3 |
设置日志级别,默认为1。
|
-r/--report-type |
all/json/html/csv |
扫描报告的格式,默认为all。
|
此处以扫描“/opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort”路径下源码,扫描报告存放至“/opt/DevKit”路径且日志级别为DEBUG为例,请根据实际情况进行修改。
1 | devkit advisor mm-check -i /opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort -f /opt/DevKit/testcase/affinity/weak_cons/bc_file -o /opt/DevKit -l 0 |
返回信息如下,并输出报告。
debug: Enter the second level command: advisor Executing static memory consistency check task, please wait... Current progress: ################################# [100%] Scanned time: 2025/04/07 03:38:29 Configuration: Scan bc files path: /opt/DevKit/testcase/affinity/weak_cons/bc_file Scan source code path: /opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort Autofix: false Generate report path: /opt/DevKit Generate report type: all Task Timeout Interval: The timeout period is not set. Log level: debug Summary: Scanned 2 bc files, there are 2 recommended modifications. For the details information, please check: /opt/DevKit/mem-check_20250407033829_7ebf.json /opt/DevKit/mem-check_20250407033829_7ebf.html /opt/DevKit/mem-check_20250407033829_7ebf.csv
参数 |
说明 |
---|---|
配置信息 |
显示软件源码文件及BC文件存放路径。 |
需要修改的源码文件 |
显示需要存在内存一致性问题需要进行修改的源码文件路径等相关信息。 |