Build Affinity
The build affinity function analyzes the content that can be replaced with content in the Kunpeng library, and provides replacement suggestions and function repair.
Command Function
Checks build affinity.
Syntax
1 | devkit advisor affi-check [-h | --help] {-i INPUT_PATH | --input INPUT_PATH} {-c COMMAND | --cmd COMMAND} [-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
Parameter |
Option |
Description |
|---|---|---|
-h/--help |
- |
Obtains help information. This parameter is optional. |
-i/--input |
- |
Path to the source code folder. This parameter is mandatory. |
-c/--cmd |
- |
Source code build command. This parameter is mandatory. Builds source code. If there are multiple build commands, separate them with semicolons (;) and enclose them with single quotation marks (') or double quotation marks ("). If a command contains spaces, enclose it with single or double quotation marks. Example: "mkdir build;cd build;cmake ..;make" NOTE:
The source code build command in the command line tool does not support variable setting and environment variable export. Example: "CFLAGS='-O0 -g';make" or "export CFLAGS='-O0 -g';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 Module-name_Timestamp. This parameter is optional. |
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1. This parameter is optional.
|
-r/--report-type |
all/json/html/csv |
Scan report format, which defaults to all. This parameter is optional.
|
--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/advisor/project directory is scanned and the build command is make. Replace the example parameter values with the actual ones.
1 | devkit advisor affi-check -i /home/advisor/project -o /home/output -c make |
If you check build affinity in the source code path, the directory is empty when the ls command is executed after the analysis is complete. In this case, return to the parent directory, go to the source code path again, and run the ls command to view related files.
The following information is displayed and a report is generated:
Executing Build Affinity Analysis task, please wait...
Data initialization.
Current progress: ### [10%]
Compiling the project. It may take a long time. Please wait...
Current progress: #################### [60%]
Optimization suggestions for the matching acceleration library.
Current progress: ################################# [100%]
Build Affinity Analysis task has been executed.
Scanned time: 2025/04/08 11:45:51
Scan status: Succeed. Some items are recommended to be modified.
Configuration:
Source code file path: /home/advisor/project
Log level: info
Report type: all
Timeout interval setting: The timeout period is not set.
Summary:
1 dependency files can be accelerated.
For the detailed information, please check:
/home/output/affi-check_20250408114551_565e.json
/home/output/affi-check_20250408114551_565e.html
/home/output/affi-check_20250408114551_565e.csv
Output Report
Parameter |
Description |
|---|---|
Configuration |
Displays the software source file path. |
Source File to Be Modified |
Displays build affinity issues and information such as the path to the source file that needs to be modified. |