Checking Cache Line Alignment
The cache line alignment check function checks the 128-byte alignment of structure variables in the C/C++ source code to improve memory access performance.
Command Function
Performs 128-byte alignment check on structure variables in C/C++ source code.
Syntax
1 | devkit advisor cacheline [-h | --help] {-i INPUT_PATH | --input INPUT_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. This parameter is optional. |
-i/--input |
input_path |
Path to the source code folder to be scanned. This parameter is mandatory. |
-o/--output |
output_path |
Path for storing scan reports. By default, scan reports are stored in the current execution path. A report name is the format of Module-name_Timestamp. This parameter is optional. |
-r/--report-type |
all/json/html/csv |
Scan report format, which defaults to all. This parameter is optional.
|
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1. This parameter is optional.
|
--set-timeout |
time |
Timeout interval of a task, in minutes. This parameter is optional. 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. |
Example
In this example, the source code in the /home/test_code/vecanalyzer directory is scanned, the scan report is stored in the /home/out directory, and the default values are retained for the other parameters. Replace the example parameter values with the actual ones.
1 | devkit advisor cacheline -i /home/test_code/vecanalyzer -o /home/out/ |
The following information is displayed and a report is generated:
Executing Cacheline Alignment Check task, please wait...
Current progress: ################################# [100%]
Scanned time: 2025/04/07 03:00:02
Configuration:
Scan source code path: /home/test_code/vecanalyzer
Generate report path: /home/out
Generate report type: all
Task Timeout Interval: The timeout period is not set.
Log level: info
Summary:
Scanned 1 files, there are 1 recommended modifications.
For the details information, please check:
/home/out/cacheline_20250407030002_740e.json
/home/out/cacheline_20250407030002_740e.csv
/home/out/cacheline_20250407030002_740e.html
Output Report
Parameter |
Description |
|---|---|
Configuration |
Displays the software source file path. |
Source File to Be Modified |
Displays information such as the path to the source file that needs to be modified. |