Rate This Document
Findability
Accuracy
Completeness
Readability

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] [-l {0,1,2,3} | --log-level {0,1,2,3}] [-r {all,json,html,csv} | --report-type {all,json,html,csv}] [--set-timeout TIMEOUT]

Parameter Description

Table 1 Parameter description

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-i/--input

-

Path to the source code folder to be scanned. This parameter is mandatory.

-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 Module-name_Timestamp. This parameter is optional.

-l/--log-level

0/1/2/3

Log level, which defaults to 1. This parameter is optional.
  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

-r/--report-type

all/json/html/csv

Scan report format, which defaults to all. This parameter is optional.
  • 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.

--set-timeout

-

Timeout interval of a task, in minutes. If the execution duration exceeds the timeout interval, the task exits. This parameter is optional. 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

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 to the source file that needs to be modified.