-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·91 lines (87 loc) · 2.32 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
usage()
{
echo "Usage : $0 [ OPTIONS ]"
echo "Options : "
echo " -s : Setup"
echo " -m : Make"
echo " -t <test number> : Test"
echo " -c : Clean"
}
if [ $# -eq 0 ]
then
usage
exit
fi
while getopts "smt:c" opt ;do
case "${opt}" in
s)
echo "Installing Intel PIN"
URL=https://software.intel.com/sites/landingpage/pintool/downloads/pin-3.7-97619-g0d0c92f4f-gcc-linux.tar.gz
wget $URL -O pin.tar.gz
tar -xvf pin.tar.gz
rm pin.tar.gz
#Install Ubuntu Dependencies
sudo apt-get install gcc-multilib g++-multilib libc6-dev-i386
#Rename pin directory
mv pin-* pin
mkdir out/
cd src
export PIN_ROOT=../pin/
make
mv obj-intel64/ ../out
echo "=================================================="
echo " Setup Completed "
echo "=================================================="
echo " Now run with : pin/pin -t obj/maintrace.so -o <logfile> -- <file to be traced>"
;;
m)
rm -rf out/
cd src
export PIN_ROOT=../pin/
make
mv obj-intel64/ ../out
echo "=================================================="
echo " Make Completed "
echo "=================================================="
echo " Now run with : pin/pin -t obj/maintrace.so -o <logfile> -- <file to be traced>"
;;
t)
rm -rf out/
cd src
export PIN_ROOT=../pin/
make
mv obj-intel64/ ../out
cd ..
cd test/
make
cd ..
echo "=================================================="
echo " Make Completed "
echo "=================================================="
if [ ${OPTARG} = "1" ]; then
echo "Now running : ./pin/pin -t out/main_trace.so -o out.log -- test/basic1/basic1"
./pin/pin -t out/main_trace.so -o out.log -- test/basic1
fi
if [ ${OPTARG} = "2" ]; then
echo "Now running : ./pin/pin -t out/main_trace.so -o out.log -- test/basic2/basic2"
./pin/pin -t out/main_trace.so -o out.log -- test/basic2
fi
if [ ${OPTARG} = "3" ]; then
echo "Now running : ./pin/pin -t out/main_trace.so -o out.log -- test/basic3/basic3"
./pin/pin -t out/main_trace.so -o out.log -- test/basic3
fi
;;
c)
rm -rf out/
rm *.log
cd test
make clean
cd ..
;;
*)
echo "Invalid Option"
usage
;;
esac
done