-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperiment.sh
executable file
·105 lines (76 loc) · 2.67 KB
/
experiment.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
#!/bin/bash
#
# Run anaylsis experiment for UVic
#
# Usage: experiment.sh
# configure base dir
BASE_DIR=$(cd "$(dirname "$0")"; pwd)
#
# source functionality
#
if [ ! -d "${BASE_DIR}" ] ; then
echo "Base directory ${BASE_DIR} does not exist."
exit 1
fi
if [ -f "${BASE_DIR}/common-functions.sh" ] ; then
source "${BASE_DIR}/common-functions.sh"
else
echo "Missing library: ${BASE_DIR}/common-functions.sh"
exit 1
fi
# load configuration and common functions
if [ -f "${BASE_DIR}/config.rc" ] ; then
source "${BASE_DIR}/config.rc"
else
echo "Missing configuration: ${BASE_DIR}/config.rc"
exit 1
fi
#
# check for tools
#
checkExecutable dar "${DAR_BIN}"
checkExecutable maa "${MAA_BIN}"
checkExecutable addr2line "${ADDR2LINE_BIN}"
checkFile uvic "${UVIC_BIN}"
checkFile map-file "${MAP_FILE}"
checkFile project-file-template "${BASE_DIR}/.project.template"
checkDirectory data-kieker-directory "${DATA_KIEKER_DIR}"
#
# Prepare output
#
info "Prepare setup"
if [ -d "${MODEL_DIR}" ] ; then
rm -rf "${MODEL_DIR}"
fi
for P in $MODEL_FILE_DIR $MODEL_MAP_DIR $MODEL_FILE_MAP_DIR $MODEL_FILE_INTERFACE_DIR $MODEL_MAP_INTERFACE_DIR $MODEL_FILE_MAP_INTERFACE_DIR ; do
mkdir -p "${P}"
done
#
# run experiment
#
info "Recover architecture"
export DAR_OPTS="-Dlogback.configurationFile=${BASE_DIR}/logback.groovy"
export MAA_OPTS="-Dlogback.configurationFile=${BASE_DIR}/logback.groovy"
"${DAR_BIN}" -l dynamic -a "${ADDR2LINE_BIN}" -c -e "${UVIC_BIN}" -o "${MODEL_FILE_DIR}" -s elf -m file-mode -E ssp -i "${DATA_KIEKER_DIR}"
"${BASE_DIR}/cleanup-model.sh" "${MODEL_FILE_DIR}"
"${DAR_BIN}" -l dynamic -a "${ADDR2LINE_BIN}" -c -e "${UVIC_BIN}" -o "${MODEL_MAP_DIR}" -s elf -ms , -m map-mode -M "${MAP_FILE}" -E ssp -i "${DATA_KIEKER_DIR}"
"${BASE_DIR}/cleanup-model.sh" "${MODEL_MAP _DIR}"
info "Enhance architecture"
"${MAA_BIN}" -s -I -i "${MODEL_MAP_DIR}" -c -o "${MODEL_MAP_INTERFACE_DIR}"
"${BASE_DIR}/cleanup-model.sh" "${MODEL_FILE_DIR}"
"${MAA_BIN}" -s -I -i "${MODEL_FILE_DIR}" -c -o "${MODEL_FILE_INTERFACE_DIR}"
"${BASE_DIR}/cleanup-model.sh" "${MODEL_FILE_INTERFACE_DIR}"
"${MAA_BIN}" -s -gs , -g "${MAP_FILE}" -i "${MODEL_FILE_DIR}" -c -o "${MODEL_FILE_MAP_DIR}"
"${BASE_DIR}/cleanup-model.sh" "${MODEL_FILE_MAP_DIR}"
"${MAA_BIN}" -s -I -i "${MODEL_FILE_MAP_DIR}" -c -o "${MODEL_FILE_MAP_INTERFACE_DIR}"
"${BASE_DIR}/cleanup-model.sh" "${MODEL_FILE_MAP_INTERFACE_DIR}"
#
# Finalize
#
info "Make models Eclipse project"
for P in $MODEL_FILE_DIR $MODEL_MAP_DIR $MODEL_FILE_MAP_DIR $MODEL_FILE_INTERFACE_DIR $MODEL_MAP_INTERFACE_DIR $MODEL_FILE_MAP_INTERFACE_DIR ; do
NAME=`basename $P`
cat "${BASE_DIR}/.project.template" | sed "s/%NAME%/$NAME/g" > "${P}/.project"
done
info "Done"
# end