Rate This Document
Findability
Accuracy
Completeness
Readability

Overview

The code samples in Table 1 described in this document demonstrate the functions of each tool of the Kunpeng DevKit. You can refer to these code samples when analyzing and optimizing your development projects in the Kunpeng DevKit.

Table 1 Code sample description

Tool

Working Mode

Scenario

Description

Code Sample

Affinity Analyzer

VS Code

Sample 1: 64-Bit Running Mode Check

This sample demonstrates how to use the 64-bit running mode check function of the Kunpeng DevKit Affinity Analyzer to port 32-bit applications (compiled using GCC 4.8.5 to 10.3.0) from the x86 platform to the 64-bit platform, perform the porting check, and provide modification suggestions.

Makefile

func001.c

func002.c

func003.c

func004.c

VS Code

Sample 2: Byte Alignment Check

The tool performs the byte alignment check to check the byte alignment of the structure variables in the source code.

Makefile

bytecheck.cpp

bytecheck.hpp

VS Code

Sample 3: Static Memory Consistency Check

(common, atomic, and lock protection scenarios)

This sample explains how to identify memory inconsistency issues through source code scanning, and modify the code based on the suggestions provided by the tool.

common.c

atomic.c

lock.c

Makefile