Checking Byte Alignment Using Command Lines
Command Function
Checks the byte alignment of structure variables in the source code.
Syntax
devkit advisor byte-align {-i INPUT_PATH | --input INPUT_PATH} {-c COMMAND | --cmd COMMAND}[-o OUTPUT_PATH | --output OUTPUT_PATH]
[-b {make,cmake, automake} | --build-tool {make,cmake, automake}] [-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 to be scanned. This parameter is mandatory. Example: /home/test1 |
-c/--cmd |
cmd |
Builds source code. This parameter is mandatory. A build command that can be executed on the current server. If the command contains spaces, enclose it using single quotation marks. |
-b/--build-tool |
make,cmake,automake |
Build tool name. This parameter is optional. The options are make (default), cmake, and automake. |
-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 |
timeout |
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 source file to be scanned.
devkit advisor byte-align -i /opt/DevKit/wtdbg2-2.5 -c make -l 0
The following information is displayed and a report is generated:
Scanned time: 2024/02/29 02:44:48
Configuration:
Scan source code path: /opt/DevKit/wtdbg2-2.5
Generate report path: /opt/DevKit/workspace/devadmin/porting/package
Generate report type: all
Task Timeout Interval: The timeout period is not set.
Log level: DEBUG
For the detailed information, please check
/opt/DevKit/workspace/devadmin/porting/package/byte-align_20240229024448_4d53.html
/opt/DevKit/workspace/devadmin/porting/package/byte-align_20240229024448_4d53.json
/opt/DevKit/workspace/devadmin/porting/package/byte-align_20240229024448_4d53.csv
Output Description
Parameter |
Description |
|---|---|
Configuration |
Displays the path of the software source file. |
Source File to Be Modified |
Displays information such as the path of the source file requires byte alignment. |