Checking Memory Consistency Using Command Lines
Command Function
Checks memory inconsistency problems in source code.
Syntax
devkit advisor mem-cons {-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
Argument |
Parameter |
Description |
|---|---|---|
-i/--input |
input_path |
Path of the source code folder corresponding to the BC file. This parameter is mandatory. Example: /home/test |
-f/--bc-file |
path |
BC folder path. BC files must exist in this path. This parameter is mandatory. Example: /home/testbc |
--autofix |
true/false |
Indicates whether to generate a compiler configuration file. This parameter is optional. Default value: false |
--autofix-dir |
path |
Path for storing the compiler configuration file. This parameter is optional. 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 |
output_path |
Path for storing the report. This parameter is optional. By default, the report is saved in the current execution path and is named in the format of Feature name_Timestamp. |
--set-timeout |
time |
Task timeout period. This parameter is optional. 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. The options are 0 (DEBUG), 1 (INFO), 2 (WARNING) and 3 (ERROR). The default value is 1 (INFO). |
-r/--report-type |
all,json,html,csv |
Format of the scan report. This parameter is optional. The default value is all, indicating that JSON, HTML, and CSV reports are generated. |
Example
Replace the path in the following example command with the actual path of the configuration file to be scanned.
devkit advisor mem-cons -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/test001/DevKit-CLI-24.0.RC1-Linux-Kunpeng
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/test001/DevKit-CLI-24.0.RC1-Linux-Kunpeng/mem-cons_20240229061648_7905.json
/home/test001/DevKit-CLI-24.0.RC1-Linux-Kunpeng/mem-cons_20240229061648_7905.html
/home/test001/DevKit-CLI-24.0.RC1-Linux-Kunpeng/mem-cons_20240229061648_7905.csv
Output Description
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. |
