当前位置:网站首页>First encounter with Kunpeng code migration tool

First encounter with Kunpeng code migration tool

2022-06-09 21:48:00 Hua Weiyun

Antecedents feed

Come on , First go to the official video link :https://www.hikunpeng.com/zh/developer/live/detail/1533984621405396993

Collocation text , The effect is better !

Introduction to Kunpeng code migration tool

image.png

Kunpeng code migration tool supports IDE plug-in unit (VS Code、IntelliJ) and browser Two working modes . This tool is divided into client 、 Server side Two parts , Use after installation .

Kunpeng code migration tool is a tool that can simplify the migration of customer applications to Kun Peng 916/920 Server for Tools for the process . The code migration tool can automatically scan and analyze the software to be migrated , Provide mobility assessment report ; You can also analyze the source code of the software to be migrated , Pinpoint the code that needs to be migrated , And provide friendly migration guidance or one click code replacement ; At the same time, support will x86 The software package reconstructs the Kunpeng platform software package 、 Special software one click migration and other enhanced functions . Note that this only applies to Development and test environment , only Support x86 Linux The software is migrated to Kunpeng Linux Scan on 、 Analysis and migration . Click to see The latest development of Kunpeng code migration tool .

Operating system requirements openEuler 20.03 (LTS)、CentOS 7.6、Ubuntu18.04、 kirin V10、UOS 20 etc. , For detailed correspondence between the operating platform and the operating system, see Compatibility query tool .

We will apply for remote laboratory in this training camp , The official recommendation is that you apply for openEuler 20.03 (LTS).

Introduction to Kunpeng code migration tool

Software Migration assessment

image.png

Software Migration assessment helps users analyze users x86 In the package installation path on the environment SO The library files , And check the compatibility of these files with Kunpeng platform . Support Web Interface and CLI Command line operations , Of course , If you want to use VS Code or IntelliJ Also no problem , There are corresponding plug-ins available .

With Web Interface as an example , Generally, you have logged in to the Kunpeng code migration tool :

  1. On the left side of the page , choice “ Software Migration assessment ”.

  2. Check... In the create analysis task area “ Analysis package ” or “ Analyze installed software ”, And configure the following parameters .

image.png

Specific description of corresponding parameters , You can see Document introduction .

  1. single click “ To analyze ”, Generate analysis report .

The pop-up page displays the task analysis progress , After analysis , single click “ Check the report ” Get into “ Migration report ” Interface .

The user can click close while the task is in progress , Cancel the task .
Support multiple users to create analysis tasks at the same time .

  1. After analysis , On the left side of the page , choice “ Software Migration assessment ”.

  2. In the list of historical reports , Click to specify the report name for the analysis task , Get into “ Migration report ” Interface .

image.png

Source code migration

The source code migration function analyzes users C/C++/ASM/Fortran/Go/ The portability of interpretive language software , The Kunpeng code migration tool can perform automatic analysis , Generate analysis report , And guide users how to migrate the file .

Come on , Introduce the general steps :

  1. Successfully log in to Kunpeng code migration tool .

  2. Configure the following parameters in the create analysis task area .

image.png

Be careful , Application for remote laboratory use , Not the compiler shown above , Should be GCC 7.3, The specific correspondence is shown in the official documents , as follows :

openEuler 20.03  The default is BiSheng Compiler 2.1.0openEuler 20.03 SP1  The default is GCC 7.3openEuler 20.03 SP2  The default is GCC 7.3openEuler 20.03 SP3  The default is GCC 7.3
  1. single click “ To analyze ”, Generate analysis report . The pop-up page displays the task analysis progress , After analysis , single click “ Check the report ” Get into “ Migration report ” Interface . Select the file here , Hover the mouse over the code of the red wavy line , You can view the source code migration suggestions .

If you need to modify the original code , Be sure to save the edited source code at any time , Otherwise, the modified code may be lost due to the session timeout .

Package refactoring

image.png

analysis x86 On the platform Linux Composition and dependency of software package , Replace the dependent files related to the platform with the version compatible with the Kunpeng platform , And reconstitute the software package applicable to Kunpeng platform .

Software package refactoring can analyze user provided x86 software package , And try to build Kunpeng platform software package according to the resource files provided by users . Software package reconfiguration requires users to use it on Kunpeng platform .

  1. On the premise that you have successfully logged in to the Kunpeng code migration tool . stay Web In the left title bar of the tool , choice “ Package refactoring ”.

image.png

  1. Fill in “ Package storage path ”. It can be done in two ways :

single click “ Upload ” Button to upload the package .

First, manually upload the software package to the specified path of the tool on the server ( for example :/opt/portadv/portadmin/packagerebuild/), to porting The user has read / write and execute permissions , Then click the filling box to select the software package in the drop-down box , You can also manually fill in the package name .

  1. Click next , Configuration dependency file .

  2. And then click “ Confirm refactoring ”.

image.png

image.png

  1. After successful refactoring , single click “ Download the refactoring package ” You can view the execution results , As shown in the figure .

image.png

Special software migration

image.png

Special software migration provides open source software migration 、 Tuned instrumented solutions . Users can select the corresponding software according to the granularity of the solution , Implement instrumented rapid migration software . Special software migration includes software downloading 、 modify 、 Compilation and package building functions , Users are required to use in the server environment based on Kunpeng .

Special software migration is for big data 、 database 、 High performance computing and Web Some of the common software source codes in such scenarios are migrated automatically 、 Compile and build the software package compatible with Kunpeng platform , This function only supports running on Kunpeng platform .

Enhancements

image.png

The Kunpeng code migration tool provides the following four enhancements :

64 Bit operation mode check

For users C/C++ Software from 32 Bit patterns migrate to 64 Bit mode is checked . The tool is forced to 64 Bit mode compiles user software , And through the compilation option, it is found that from 32 Bit patterns migrate to 64 Necessary modification of bit pattern , And prompt the user for further inspection .

Structure byte alignment check

Check the structural variables in the user software , Analyze its memory allocation , And give feedback to users .

Cache line alignment check

Yes C/C++ Structure variables in the source code 128 Byte alignment check , Improve memory access performance .

Memory consistency check

Check the memory consistency problems that may exist when the user software is migrated to the Kunpeng platform 、 Repair . The auto repair tool needs to update the GCC compiler , Then, the memory consistency problem is automatically repaired during the compilation of the user software .

summary

Kunpeng code migration tool is still very strong , It's very systematic , Relatively complete function , Very good , Greatly reduce the burden of migration .

原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206092109346805.html