-
Notifications
You must be signed in to change notification settings - Fork 6
/
process.sh
executable file
·84 lines (69 loc) · 2.53 KB
/
process.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
#!/bin/zsh
cd workloads/bitslice_aes/
source get_pcs.sh
if [ "$#" -ne 1 ]; then
echo "debug.out file not passed, trying to use results/debug.out" >&2
debugf="results/debug.out"
else
debugf=$1
fi
if [ ! -f "$debugf" ]; then
echo "Failed to find results/debug.out"
fi
fpath=${debugf%/*}
picklef="$fpath"/rois.p
echo $debugf
echo $fpath
echo $picklef
if [ $# -ne 2 ]; then
# -e 'O3PipeView:fetch.*0x0040103f' \
# -e 'O3PipeView:fetch.*0x0040118f' \
rg -A6 $debugf \
-e 'O3PipeView:fetch.*0xbeef' \
-e 'O3PipeView:fetch.*0xdead' \
-e 'O3PipeView:fetch.*0xfeed' \
-e 'O3PipeView:fetch.*0xbead' \
-e 'O3PipeView:fetch.*clflush' \
-e "O3PipeView:fetch.*0x00$delaying1" \
-e "O3PipeView:fetch.*0x00$delaying2" \
-e "O3PipeView:fetch.*0x00$delaying3" \
-e "O3PipeView:fetch.*0x00$delaying4" \
-e "O3PipeView:fetch.*0x00$post_delaying1" \
-e "O3PipeView:fetch.*0x00$post_delaying2" \
-e "O3PipeView:fetch.*0x00$post_delaying3" \
-e "O3PipeView:fetch.*0x00$post_delaying4" \
-e "O3PipeView:fetch.*0x00$target" \
| python inst_parse.py -m 6 $picklef "0x00$target"
start=0
roif=icorr_roi.debug.out
python get_ranges.py $picklef "0x00$start_pc" '0x004012dd' -s
for tick in $(python get_ranges.py $picklef "0x00$start_pc" '0x004012dd' -t -s); do
line=$(rg $tick -m 1 $debugf -n | sed -e 's|:.*||')
echo $tick "->" $line
if [ $start -eq 0 ]; then
start=$line
else
end=$line
echo $start -- $end
tail -n +"$start" $debugf | head -n $(($end - $start)) > "$fpath"/"$roif"
start=0
roif=corr_roi.debug.out
fi
done
rg -e 'O3PipeView:fetch' -A6 \
"$fpath"/corr_roi.debug.out "$fpath"/icorr_roi.debug.out -I \
| python inst_parse.py "$fpath"/roi_insts.p "0x00$target"
fi
if [ $# -eq 2 ] && [ "$2" = "-v" ]; then
rg "$fpath"/icorr_roi.debug.out "$fpath"/corr_roi.debug.out -e 'SQ size:' \
-e 'rob.*Now has' | python plot_events.py "$fpath"/roi_insts.p -v \
"0x00$target" "0x00$delaying1" "0x00$delaying2" "0x00$delaying3" \
"0x00$delaying4" "0x00$post_delaying1" "0x00$post_delaying2" \
"0x00$post_delaying3" "0x00$post_delaying4"
else
rg "$fpath"/icorr_roi.debug.out "$fpath"/corr_roi.debug.out -e 'SQ size:' \
-e 'rob.*Now has' | python plot_events.py "$fpath"/roi_insts.p -v -p \
"$fpath"/plot.pdf "0x00$target" "0x00$delaying1" "0x00$delaying2" \
"0x00$delaying3" "0x00$delaying4" "0x00$post_delaying1" \
"0x00$post_delaying2" "0x00$post_delaying3" "0x00$post_delaying4"
fi