-
Notifications
You must be signed in to change notification settings - Fork 1
/
Fig8.sh
61 lines (49 loc) · 1.28 KB
/
Fig8.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
#!/bin/bash
. ./functions
# Output files
OUT=figures/Fig8.dat
> $OUT
# 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
asizes=(64)
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 AWARE DOS ATTACKS
for asize in ${asizes[@]}; do
for ctype in ${ctypes[@]}; do
for numcr in 3 2 1; do
ctypestr="${ctype^}"
BkPLLWriteCorunVary $asize $numcr 1
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
wait &> /dev/null
done
done
done
index=$((index+1))
echo ""
sleep 3
done
# Output the slowdowns
for ((i=0;i<${#slowdowns[@]}; i++)); do
echo ${slowdowns[$i]} >> $OUT
done