Installation and Deployment
Software
- OS: openEuler 22.03 LTS SP2
Hardware
- x86_64
- AArch64
Preparing the Environment
- Install the openEuler operating system. For details, see the openEuler Installation Guide.
Install the dependency
Installing the Software on Which the PIN GCC Client Depends
yum install -y git
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 gcc-plugin-devel
yum install -y llvm-mlir
yum install -y llvm-mlir-devel
yum install -y llvm-devel
Installing the Software on Which the PIN Server Depends
yum install -y git
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 llvm-mlir
yum install -y llvm-mlir-devel
yum install -y llvm-devel
Installing PIN
Performing Installation
Installing the PIN GCC Client
yum install -y pin-gcc-client
Installing the PIN Server
yum install -y pin-server
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=${MLIR_PATH} -DLLVM_DIR=${LLVM_PATH}
make
Building the PIN Server
git clone https://gitee.com/openeuler/pin-server.git
cd pin-server
mkdir build
cd build
cmake ../ -DMLIR_DIR=${MLIR_PATH} -DLLVM_DIR=${LLVM_PATH}
make
Usage
You can use -fplugin
and -fplugin-arg-libpin_xxx
to enable the Plug-IN (PIN) tool.
Command:
$(TARGET): $(OBJS)
$(CXX) -fplugin=${CLIENT_PATH}/libpin_gcc_client.so \
-fplugin-arg-libpin_gcc_client-server_path=${SERVER_PATH}/pin_server \
-fplugin-arg-libpin_gcc_client-log_level="1" \
-fplugin-arg-libpin_gcc_client-arg1="xxx"
You can use the ${INSTALL_PATH}/bin/pin-gcc-client.json
file to configure PIN. The configuration options are as follows:
path
: path of the executable file of the PIN server.sha256file
: path of the PIN verification filexxx.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 from0
to3
. The default value is1
.-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.
- When PIN is enabled in the
-flto
phase, multi-process compilation usingmake -j
is not supported. You are advised to usemake -j1
for compilation.