Rate This Document
Findability
Accuracy
Completeness
Readability

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] [-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 to the source code folder. This parameter is mandatory.

-c/--cmd

command

Source code build command. This parameter is mandatory.

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

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.

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

-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 /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 Affinity task has been executed.
Scanned time: 2025/04/07 03:45:53
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_20250407034553_e35a.json
    /home/output/affi-check_20250407034553_e35a.html
    /home/output/affi-check_20250407034553_e35a.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 that needs to be modified.