Skip to content

Building Dynamorio Tools

huangvincent170 edited this page Oct 1, 2021 · 13 revisions

Machine used: flubber3.crnch.gatech.edu

Trace Delimiting

Download latest version build of Dynamorio (Dynamorio-Linux) https://github.com/DynamoRIO/dynamorio/releases/tag/cronbuild-8.0.18895

$ tar –xvf DynamoRIO-Linux-8.0.18895.tar.gz 
$ git clone https://github.com/hpcgarage/spatter.git 
$ cd spatter/ 
$ git checkout dynamorio_integration 
$ . /tools/misc/env/spatter_build.sh 
$ vim ./configure/configure_omp_intel

On line 41, change -D DynamoRIO_DIR=~/dynamorio/build/cmake \ to where the dynamorio cmake dir is located

$ vim DynamoRIO-Linux-8.0.18895/cmake/DynamoRIOConfig.cmake 

On line 533, delete the lines which say

_DR_identify_clang() 
if (NOT CMAKE_COMPILER_IS_GNUCC) 
  # Our linker script is GNU-specific 
  message(FATAL_ERROR "DynamoRIO's CMake configuration only supports the GNU linker on Linux") 
endif (NOT CMAKE_COMPILER_IS_GNUCC) 

On line 1101, change that line that says target_link_libraries(${target} dynamorio) to target_link_libraries(${target} LINK_PUBLIC dynamorio)

$ ./configure/configure_omp_intel
$ cd ./build_omp_intel
$ make
$ cd ../../
$ ./DynamoRIO-Linux-8.0.18895/bin64/drrun -noinject -c ./DynamoRIO-Linux-8.0.18895/samples/bin64/libopcodes.so -- ./spatter/build_omp_intel/spatter -pUNIFORM:8:1 -t1

Trace register states

Download latest version build of Dynamorio (Dynamorio-Linux) https://github.com/DynamoRIO/dynamorio/releases/tag/cronbuild-8.0.18895

$ tar –xvf DynamoRIO-Linux-8.0.18895.tar.gz 
$ git clone https://github.com/hpcgarage/spatter.git
$ cd spatter
$ vim configure/configure_omp_intel

Uncomment the following line and change -O3 to -O2

#Cross-platform but with AVX (KNL, SKL and newer)
#FLAGS="-O3 -xCOMMON-AVX512"

Comment out the following line

#Disable flag that reports on cpu dispatch
FLAGS="-O3 -std=c99 -diag-disable=15009"
$ . /tools/misc/env/spatter_build.sh
$ ./configure/configure_omp_intel
$ git clone https://github.com/hpcgarage/trace_analysis.git
$ cd trace_analysis
$ git checkout dynamorio_client
$ cd client/
$ mkdir build
$ cd build/
$ cmake -DDynamoRIO_DIR=[dynamorio_path]/cmake/ ..
$ make

Clone this wiki locally