afa7789 / dynamorio_instruction_count

Instruction tool to be used with DynamoRIO that counts the number of machine instructions in a application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

!Theme Image

Dynamo Tool

Block counter

Simple instrumentation for instruction counting made on c++ to be used with dynamorio.

Disclaimer

The instructions tool was made with the tutoring and help of Andrei Rimsa. Andrei is my professor and thesis tutor from CEFET-MG.

How to Install

Install Dynamorio.

git clone https://github.com/DynamoRIO/dynamorio.git
cd dynamorio
DYNAMORIO_HOME=$(pwd);

This tool package

# go into the correct folder
cd api/samples
# clone to the here
git clone https://github.com/afa7789/dynamorio_instruction_count.git dynamo_tool
# extract it
cp ./{dyn.patch,bbl_count.cpp} .
# Add line to CMakeLists
patch < dyn.patch

Running the tool

Make first

Make Dynamorio

make sure you have set DYNAMORIO_HOME env var at the root of the dynamorio folder.

cd $DYNAMORIO_HOME
mkdir build && cd build
cmake  -DBUILD_DOCS=no ..
make -j

make tool

cd build
make bbl_count

Running it

Commands to run this code

bbl_count.c

$DYNAMORIO_HOME/bin64/drrun -c bin/libbbl_count.so -- ls 
# how to use to get the output to a file.
$DYNAMORIO_HOME/bin64/drrun -c bin/libbbl_count.so arquivo_test.txt -- ls 
# Example on how to run it with a full path
# By doing like this you can from anywhere in your computer
$DYNAMORIO_HOME/build/bin64/drrun -c /home/afa/Documents/code/TCC/dynamorio/dynamorio/build/api/samples/../bin/libbbl_count.so -- ls 

About

Instruction tool to be used with DynamoRIO that counts the number of machine instructions in a application.


Languages

Language:C 100.0%