-
Notifications
You must be signed in to change notification settings - Fork 1
/
Fig4.sh
112 lines (95 loc) · 2.35 KB
/
Fig4.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
. ./functions
# Output files
OUT1=figures/Fig4-Slowdown.dat
OUT2=figures/Fig4-Missrate.dat
> $OUT1
> $OUT2
# Parameters for the victim workload
vsizes=(64 128 192 256 320 1024 2048)
viters=(10000 10000 10000 10000 10000 10000 10000)
vtypes=read
vtypestr="${vtype^}"
# Parameters for the attacker workloads
csizes=(64)
asizes=(64)
dsizes=(16384)
ctypes=(write)
# Array to track slowdowns and LLC missrates across victim WSS
slowdowns=()
missrates=()
index=0
for vsize in ${vsizes[@]}; do
slowdowns+=(); slowdowns[$index]+="$vsize "
missrates+=(); missrates[$index]+="$vsize "
echo "Bw${vtypestr}($vsize) Victim"
echo "Corun, Bandwidth, Latency, Slowdown, LLC_miss, LLC_access, LLC_missrate"
# SOLO CASE
BwReadVictimSolo $vsize ${viters[$index]}
slowdowns[$index]+="1.00 "
missrates[$index]+="$l2missrate "
# VS CACHE BANK OBLIVIOUS DOS ATTACKS
for csize in ${csizes[@]}; do
# BW
for ctype in ${ctypes[@]}; do
ctypestr="${ctype^}"
BwWriteCorun $csize
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
wait &> /dev/null
done
# PLL
for ctype in ${ctypes[@]}; do
ctypestr="${ctype^}"
PLLWriteCorun $csize
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
done
done
# VS CACHE BANK AWARE DOS ATTACKS
for asize in ${asizes[@]}; do
for ctype in ${ctypes[@]}; do
ctypestr="${ctype^}"
BkPLLWriteCorun $asize 1
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
wait &> /dev/null
done
done
# VS PRIOR DOS-FITTING DOS ATTACKS
for dsize in ${dsizes[@]}; do
# BW
BwWriteCorun $dsize
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
# PLL
PLLWriteCorun $dsize
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
done
index=$((index+1))
echo ""
sleep 3
done
# Output the slowdowns and missrates
for ((i=0;i<${#slowdowns[@]}; i++)); do
echo ${slowdowns[$i]} >> $OUT1
done
for ((i=0;i<${#missrates[@]}; i++)); do
echo ${missrates[$i]} >> $OUT2
done