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

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

Table 1 Parameter description

Parameter

Option

Description

-h/--help

-

Obtains help information.

-i/--input

input_path

Path of 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.

-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.

-l/--log-level

0/1/2/3

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

--set-timeout

time

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.

Example

In this example, the source code in the /home/test_code/vecanalyzer directory is scanned. Retain the default values for the other parameters. Replace the example parameter values with the actual ones.

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: 2024/06/12 03:59:22

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 3 files, there are 1 recommended modifications. 

For the details information, please check:
/home/out/cacheline_20240612035922_3710.json
/home/out/cacheline_20240612035922_3710.csv
/home/out/cacheline_20240612035922_3710.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 of the source file that needs to be modified.