Cachediff is a tool to study the effect of cache performance between two versions (differing from each other by a small diff/delta) of the same C/C++ program. This is useful to students, educationist and professionals. Cachediff presents to the user a localized and global view of the cache and its statistics. It uses cache simulation based on instruction/memory tracing during execution. It can be extended to support n-versions of the same program.
##Usage
python cachediff.py program1.c program2.c input1.c input2.c
To run the test-suite
nosetests
##Requirements
export PIN=/path/to/pin/folder
export DINERO=/path/to/dinero/folder
- Disable ASLR(Dont forget to revert once done, this is a SECURITY HAZARD)
##Instruction Manual
-
Download the github-repo of Cachediff and extract the tar file.
-
Download the Intel Pin and extract the tar file and rename the folder to "pin".
-
Download the DineroIV and extract the tar file and rename the folder to dinero.
-
Now replace the the MyPinTool folder from
your_present_directory/pin/source/tools/MyPinTool to your_present_directory/cachediff/pin/source/tools/MyPinTool
This can be done by
your_present_directory$: rm -r pin/source/tools/MyPinTool
your_present_directory$: cp your_present_directory/cachediff/pin/source/tools/MyPinTool pin/source/tools/
- Make the Intel Pin
your_present_directory$: cd pin/source/tools/
your_present_directory$: make
your_present_directory$: cd ../../..
- Make the DineroIV
your_present_directory$: cd dinero
your_present_directory$: make
your_present_directory$: cd ..
- Set environmental variables :
your_present_directory$: echo "export PIN=/path/to/pin/folder" >> ~/.bashrc
your_present_directory$: echo "export PIN=/path/to/dinero/folder" >> ~/.bashrc
your_present_directory$: source ~/.bashrc
your_present_directory$: setarch `uname -m` -R /bin/bash
(Dont forget to revert once done, this is a SECURITY HAZARD)
- Now you are ready to run the script,
python3 cachediff.py program1.c program2.c input_stream1.txt input_stream2.txt
where,
- program1.c - the original program
- program2.c - the modified version of the original program
- input_stream1 - input to program1
- input_stream2 - input to program2