Rate This Document
Findability
Accuracy
Completeness
Readability

Static Memory Consistency Check

The tool checks for any memory consistency problem when the source code is ported to the Kunpeng platform and provides suggestions on inserting memory barriers.

  • Before using this function, ensure that the drive where the tool is installed has sufficient space. During the weak memory sequence checks, large intermediate files are generated. According to empirical data, about 100 GB of available memory is required for every 100,000 lines of code.
  • The check of a large amount of source code consumes many resources. It is recommended the code to be checked do not exceed 100,000 lines.
  • The static memory consistency check function is available on the Kunpeng platform.

Prerequisites

You have logged in to the Kunpeng DevKit.
  • /opt is the default installation directory of the tool. The following uses this directory as an example. Replace it with the actual directory.
  • On the WebUI, this feature requires uploading the files or compressed package. In the IDE, the tool plugin can scan local projects. If the source code is included in a compressed package, decompress the package and select the decompressed folder.

Procedure

  1. On the left pane of the page, choose Affinity Analyzer > Static Memory Consistency Check, and click to create a task. See Figure 1.
    Figure 1 Static memory consistency check
  2. Select a check mode.
    • Static check
    • Auto repair by compiler. For details, see Using the Auto Repair by Compiler.

      The static check features low false positive ratio and a repair rate up to 60%. The auto repair by compiler does not miss any report and features a repair rate of 100%, but the false positive ratio is higher. Higher false positive ratio indicates greater impact on performance. The repair rate varies depending on the software, and the impact on performance also varies.

  3. Set Source file path using either of the following methods:
    • If you want to use uploaded source code, click the text box and select a source code path from the drop-down list or manually enter a source code path.
    • Click Upload on the right to upload the package or folder. (The package is automatically decompressed during the upload.)
      • Only TAR, TAR.BZ, TAR.BZ2, TAR.GZ, TAR.XZ, TBZ, TBZ2, TGZ, TXZ and ZIP packages can be uploaded. Only one package can be uploaded at a time. The source package cannot exceed 1 GB, and the extracted files must be less than or equal to half of the remaining drive space.
      • Only one folder can be uploaded at a time. The size of the folder must be less than or equal to half of the remaining drive space.
  4. Set BC File Path using either of the following methods:
    • If you want to use an uploaded BC file, click the text box and select a BC path from the drop-down list or manually enter a BC path.
    • Click Upload on the right to upload the package or folder. (The package is automatically decompressed during the upload.)
    • For details about the BC file and how to obtain it, see Generating a BC File.
    • Only TAR, TAR.BZ, TAR.BZ2, TAR.GZ, TAR.XZ, TBZ, TBZ2, TGZ, TXZ and ZIP packages can be uploaded. Only one package can be uploaded at a time. The source package cannot exceed 1 GB, and the extracted files must be less than or equal to half of the remaining drive space.
    • Only one folder can be uploaded at a time. The size of the folder must be less than or equal to half of the remaining drive space.
  5. Choose whether to generate a compiler configuration file. The default value is Disabled.
  6. Click Check to start the static memory consistency check. After the check is complete, the check report page is displayed. See Figure 2.
    Figure 2 Static memory consistency check report
    • You can click to sort the source files to be modified by path or number of recommended modifications.
    • You can click Download Report (.csv) or Download Report (.html) to download the report to your local PC.
    • If Generating compiler tool configuration files is selected, you can click Download compiler configuration files to download the file. You can also hover the mouse pointer over the of the target report in the Historical Reports area and select Download compiler configuration files.
    • If the system displays a message indicating that the compiler file is not the latest, click Go to download the file from the latest report. If the system displays a message indicating that the latest report does not contain the compiler configuration file, perform operations as prompted.
  7. Click View Suggested Source Code. The Source Code Modification Suggestion tab page is displayed. See Figure 3.
    Figure 3 Source code modification suggestion
    • The tool supports concurrent running of multiple static memory consistency check tasks.
    • To cancel a task, click Close during the task running process.
    • You can click the arrow keys in the upper right corner of Original Source Code to view the code.
    • If you use shortcut keys to modify the source code, pay attention to shortcut key conflicts caused by the input method or IDE environment.
    • If the check fails or the check result indicates that no modification is required, an empty report is generated.
    • If the system displays a message indicating that the task times out, rectify the fault by following instructions in Task Timed Out.