Memory Consistency Check
The memory consistency check function checks for any memory consistency problem when the source code is ported to the Kunpeng platform and provides suggestions on inserting memory barriers.
Command Function
Checks memory inconsistency problems in source code.
Syntax
devkit advisor mm-check {-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]
Parameter Description
Parameter |
Option |
Description |
|---|---|---|
-h/--help |
- |
Obtains help information. |
-i/--input |
- |
Path of the source code folder corresponding to the BC file. |
-f/--bc-file |
- |
BC folder path. BC files must exist in this path. NOTE:
|
--autofix |
true/false |
Indicates whether to generate a compiler configuration file. The default value is false. |
--autofix-dir |
- |
Path for storing the compiler configuration file. By default, the file is generated in the source code folder in the tool directory. The file takes effect only when the --autofix parameter is used and is set to true. |
-o/--output |
- |
Path for storing scan reports. By default, scan reports are stored in the current execution path. A report name is the format of Feature name_Timestamp. |
--set-timeout |
- |
Timeout interval of a task, in minutes. If the execution duration exceeds the timeout interval, the task exits. By default, there is no timeout interval. The task will be executed until it is complete. |
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1.
|
-r/--report-type |
all/json/html/csv |
Scan report format, which defaults to all.
|
Example
In this example, the source code in the /opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort directory is scanned.
devkit advisor mm-check -i /opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort -f /opt/DevKit/testcase/affinity/weak_cons/bc_file -l 0
The following information is displayed and a report is generated:
Scanned time: 20240229061648
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: /home/DevKit_Software
Generate report type: all
Task Timeout Interval: The timeout period is not set.
Log level: debug
Summary:
Scanned 2 bc files, there are 6 recommended modifications.
For the details information, please check:
/home/DevKit_Software/mem-check_20240229061648_7905.json
/home/DevKit_Software/mem-check_20240229061648_7905.html
/home/DevKit_Software/mem-check_20240229061648_7905.csv
Output Report
Parameter |
Description |
|---|---|
Configuration |
Displays the path of the software source file and BC file. |
Source File to Be Modified |
Displays information such as the path of the source file that needs to be modified. |