Rate This Document
Findability
Accuracy
Completeness
Readability

Byte Alignment Check

The byte alignment check function checks the byte alignment of structure variables in the source code.

Command Function

Checks the byte alignment of structure variables in the source code.

Syntax

devkit advisor addr-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

Table 1 Parameter description

Parameter

Option

Description

-h/--help

-

Obtains help information.

-i/--input

-

Path of the source code folder to be scanned.

-c/--cmd

-

Source code build command. 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, which defaults to make.

-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.
  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

-r/--report-type

all/json/html/csv

Scan report format, which defaults to all.
  • all: generates reports in JSON, HTML, and CSV formats.
  • json: generates a report only in JSON format.
  • html: generates a report only in HTML format.
  • csv: generates a report only in CSV format.

Example

In this example, the source code in the /opt/DevKit/wtdbg2-2.5 folder is scanned, the build command is make, and the log level is DEBUG.

devkit advisor addr-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: info

For the detailed information, please check
    /opt/DevKit/workspace/devadmin/porting/package/addr-align_20240229024448_4d53.html
    /opt/DevKit/workspace/devadmin/porting/package/addr-align_20240229024448_4d53.json
    /opt/DevKit/workspace/devadmin/porting/package/addr-align_20240229024448_4d53.csv

Output Report

Table 2 Output report parameters

Parameter

Description

Configuration

Displays the software source file path.

Source File to Be Modified

Displays information such as the path of the source file requires byte alignment.