Long-Term Supported Versions

    Innovation Versions

      Installation and Deployment

      Software

      • OS: openEuler 23.09

      Hardware

      • x86_64
      • AArch64

      Preparing the Environment

      Install the dependency

      Installing the Software on Which the PIN GCC Client Depends

      yum install -y gcc
      yum install -y gcc-c++
      yum install -y gcc-plugin-devel
      yum install -y make
      yum install -y cmake
      yum install -y grpc
      yum install -y grpc-devel
      yum install -y grpc-plugins
      yum install -y protobuf-devel
      yum install -y jsoncpp
      yum install -y jsoncpp-devel
      yum install -y mlir
      yum install -y mlir-devel
      yum install -y llvm-devel
      yum install -y llvm-test
      

      Installing the Software on Which the PIN Server Depends

      yum install -y gcc  # Recommended in case there is no default compiler in the enlivenment.
      yum install -y gcc-c++ # Recommended in case there is no default compiler in the enlivenment.
      yum install -y make
      yum install -y cmake
      yum install -y grpc
      yum install -y grpc-devel
      yum install -y grpc-plugins
      yum install -y protobuf-devel
      yum install -y jsoncpp
      yum install -y jsoncpp-devel
      yum install -y mlir
      yum install -y mlir-devel
      yum install -y llvm-devel
      yum install -y llvm-test
      

      Installing PIN

      rpmbuild

      Building the PIN GCC Client

      git clone https://gitee.com/src-openeuler/pin-gcc-client.git
      cd pin-gcc-client
      mkdir -p ~/rpmbuild/SOURCES
      cp *.patch pin-gcc-client-0.4.1.tar.gz ~/rpmbuild/SOURCES
      rpmbuild -ba pin-gcc-client.spec
      cd  ~/rpmbuild/RPMS/aarch64      // aarch64|x86_64
      rpm -ivh pin-gcc-client-0.4.1-12.aarch64.rpm  // aarch64|x86_64
      

      Building the PIN Server

      git clone https://gitee.com/src-openeuler/pin-server.git
      cd pin-server
      mkdir -p ~/rpmbuild/SOURCES
      cp *.patch pin-server-0.4.0.tar.gz ~/rpmbuild/SOURCES
      rpmbuild -ba pin-server.spec
      cd  ~/rpmbuild/RPMS/aarch64      // aarch64|x86_64
      rpm -ivh pin-server-demo-0.4.0-14.aarch64.rpm // aarch64|x86_64
      rpm -ivh pin-server-0.4.0-14.aarch64.rpm // aarch64|x86_64
      

      Build

      Building the PIN GCC Client

      git clone https://gitee.com/openeuler/pin-gcc-client.git
      cd pin-gcc-client
      mkdir build
      cd build
      cmake ../ -DMLIR_DIR=/usr/lib64/cmake/mlir -DLLVM_DIR=/usr/lib64/cmake/llvm
      make
      

      Building the PIN Server

      git clone https://gitee.com/openeuler/pin-server.git
      cd pin-server
      mkdir build
      cd build
      cmake ../ -DMLIR_DIR=/usr/lib64/cmake/mlir -DLLVM_DIR=/usr/lib64/cmake/llvm
      make
      

      Usage

      You can use -fplugin and -fplugin-arg-libpin_xxx to enable the Plug-IN (PIN) tool. Command:

      gcc -fplugin=${CLIENT_PATH}/build/libpin_gcc_client.so \
          -fplugin-arg-libpin_gcc_client-server_path=${SERVER_PATH}/build/pin_server \
          -fplugin-arg-libpin_gcc_client-log_level="1" \
          -fplugin-arg-libpin_gcc_client-arg1="xxx" \
          $(SOURCE)
      

      You can use the /usr/local/bin/pin-gcc-client.json file to configure PIN. If the file does not exist in /usr/local/bin, you can copy it from /usr/bin if PIN is installed using RPM, or the configs directory of the PIN client source code. The configuration options are as follows:

      path: path of the executable file of the PIN server.

      sha256file: path of the PIN verification file xxx.sha256.

      timeout: timeout interval for cross-process communication, in milliseconds.

      Compile options:

      -fplugin: path of the .so file of the PIN client.

      -fplugin-arg-libpin_gcc_client-server_path: path of the executable program of the PIN server.

      -fplugin-arg-libpin_gcc_client-log_level: default log level. The value ranges from 0 to 3. The default value is 1.

      -fplugin-arg-libpin_gcc_client-argN: other parameters that can be specified as required. argN indicates the argument required by PIN.

      Compatibility

      This section describes the compatibility issues in some special scenarios. This project is in continuous iteration and will be fixed as soon as possible. Developers are welcome to join this project.

      • PIN has been adapted for LLVM 15. Currently, only basic statistical plugins are supported.

      Bug Catching

      Buggy Content

      Bug Description

      Submit As Issue

      It's a little complicated....

      I'd like to ask someone.

      PR

      Just a small problem.

      I can fix it online!

      Bug Type
      Specifications and Common Mistakes

      ● Misspellings or punctuation mistakes;

      ● Incorrect links, empty cells, or wrong formats;

      ● Chinese characters in English context;

      ● Minor inconsistencies between the UI and descriptions;

      ● Low writing fluency that does not affect understanding;

      ● Incorrect version numbers, including software package names and version numbers on the UI.

      Usability

      ● Incorrect or missing key steps;

      ● Missing prerequisites or precautions;

      ● Ambiguous figures, tables, or texts;

      ● Unclear logic, such as missing classifications, items, and steps.

      Correctness

      ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

      ● Incorrect schematic or architecture diagrams;

      ● Incorrect commands or command parameters;

      ● Incorrect code;

      ● Commands inconsistent with the functions;

      ● Wrong screenshots.

      Risk Warnings

      ● Lack of risk warnings for operations that may damage the system or important data.

      Content Compliance

      ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

      ● Copyright infringement.

      How satisfied are you with this document

      Not satisfied at all
      Very satisfied
      Submit
      Click to create an issue. An issue template will be automatically generated based on your feedback.
      Bug Catching
      编组 3备份