forked from xlab-uiuc/emt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyze_data.sh
More file actions
executable file
·119 lines (106 loc) · 3.7 KB
/
analyze_data.sh
File metadata and controls
executable file
·119 lines (106 loc) · 3.7 KB
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
113
114
115
116
117
118
119
#!/usr/bin/env bash
set -e
input_dir="/data/EMT"
dry_run=false
ipc_stat_py=$(realpath ipc_with_inst.py)
ipc_stat_folder=$(realpath ./ipc_stats)
inst_stat_py=$(realpath ./VM-Bench/run_scripts/get_unified_kern_inst_ae.py)
inst_stat_folder=$(realpath ./inst_stats)
ipc_analyze_py=$(realpath ecpt_unified.py)
inst_analyze_py=$(realpath kern-inst-breakdown-with-khuge-unified.py)
graph_folder=$(realpath ./graph)
thp=never
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--dry)
dry_run="true"
shift 1
;;
--thp)
if [[ -z "$2" ]]; then
echo "Error: --thp requires a non-empty argument."
exit 1
fi
thp="$2"
shift 2
;;
--input)
if [[ -z "$2" ]]; then
echo "Error: --input requires a non-empty argument."
exit 1
fi
input_dir="$2"
shift 2
;;
--ipc_stats)
if [[ -z "$2" ]]; then
echo "Error: --ipc_stats requires a non-empty argument."
exit 1
fi
ipc_stat_folder="$2"
shift 2
;;
--inst_stats)
if [[ -z "$2" ]]; then
echo "Error: --inst_stats requires a non-empty argument."
exit 1
fi
inst_stat_folder="$2"
shift 2
;;
--graph)
if [[ -z "$2" ]]; then
echo "Error: --graph requires a non-empty argument."
exit 1
fi
graph_folder="$2"
shift 2
;;
*)
echo "Unknown option: $key"
exit 1
;;
esac
done
if [[ $dry_run != true ]]; then
if [[ "$thp" == "never" || "$thp" == "all" ]]; then
python $ipc_stat_py --input $input_dir --output $ipc_stat_folder --thp never
cd VM-Bench
python $inst_stat_py --input $input_dir --output $inst_stat_folder --thp never
cd ..
python $ipc_analyze_py --input $ipc_stat_folder --output $graph_folder --thp never
python $inst_analyze_py --input $inst_stat_folder --output $graph_folder --thp never
fi
if [[ "$thp" == "always" || "$thp" == "all" ]]; then
python $ipc_stat_py --input $input_dir --output $ipc_stat_folder --thp always
cd VM-Bench
python $inst_stat_py --input $input_dir --output $inst_stat_folder --thp always
cd ..
python $ipc_analyze_py --input $ipc_stat_folder --output $graph_folder --thp always
python $inst_analyze_py --input $inst_stat_folder --output $graph_folder --thp always
fi
else
echo "Input directory: $input_dir"
echo "IPC stats folder: $ipc_stat_folder"
echo "Inst stats folder: $inst_stat_folder"
echo "Graph folder: $graph_folder"
echo "THP setting: $thp"
# output all commands:
if [[ "$thp" == "never" || "$thp" == "all" ]]; then
echo "python $ipc_stat_py --input $input_dir --output $ipc_stat_folder --thp never"
echo "cd VM-Bench"
echo "python $inst_stat_py --input $input_dir --output $inst_stat_folder --thp never"
echo "cd .."
echo "python $ipc_analyze_py --input $ipc_stat_folder --output $graph_folder --thp never"
echo "python $inst_analyze_py --input $inst_stat_folder --output $graph_folder --thp never"
fi
if [[ "$thp" == "always" || "$thp" == "all" ]]; then
echo "python $ipc_stat_py --input $input_dir --output $ipc_stat_folder --thp always"
echo "cd VM-Bench"
echo "python $inst_stat_py --input $input_dir --output $inst_stat_folder --thp always"
echo "cd .."
echo "python $ipc_analyze_py --input $ipc_stat_folder --output $graph_folder --thp always"
echo "python $inst_analyze_py --input $inst_stat_folder --output $graph_folder --thp always"
fi
fi