To build BiRFIA, you need the following dependencies installed:
- Python 2.7
- CMake >= 3.5
- DynInst >= 10.0.0
- PAPI
- GCC >= 9.0
For convenience, you can build and install the dependencies via spack:
git clone https://github.com/spack/spack.git
. ./spack/share/spack/setup-env.sh
spack install dyninst papi
spack load dyninst papi
cd ..
git clone git@github.com:buaa-hipo/BIRA.git
# the compiled binaries and libraries are installed in install/
./build.sh
Load the environment to use the installed BiRFIA:
# make sure we are in the root directory of this repo
cd BIRA
# load the environment variables
source env.sh
To use BiRFIA, you neet to complete each step of the Build & Install Usage:
Before running, one must set BIRA_COLLECT_PMU_EVENT
and BIRA_MEASUREMENT_DIR
environment variables to specify the collected PMU event and output dir.
bira -i <EXE> -f <FUNC> -l <custom external shared library> [--tp]
#
# -i EXE
# EXE: the input binary file
# --tp:
# enable parameters tracing
# -f FUNC:
# FUNC: the target function name
# -l:
# external shared library for linking
#
Use libempty_func.so as the parameter of bira -l to implement instrumenting empty functions before and after the target function.
$ bira -i <EXE> -f <FUNC> -l /path/to/libempty_func.so
Use libtrace_pmu.so as the parameter of bira -l to implement a function that is instrumented before and after the target function to collect PMU counter of the target function.
$ bira -i <EXE> -f <FUNC> -l /path/to/libtrace_pmu.so
Use libtrace_params.so as the parameter of bira -l to implement a function that is instrumented before and after the target function to trace the parameters of the target function.
$ bira -i <EXE> -f <FUNC> -l /path/to/libtrace_params.so --tp