-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-all-benchmarks.sh
executable file
·60 lines (48 loc) · 2.01 KB
/
run-all-benchmarks.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
#!/bin/bash
# These benchmarks will not be run as we noticed them to not work
ignore_benchmarks=("tomcat" "tradebeans" "tradesoap" "tradebeans")
command_pid=0
# Function to handle Ctrl+C (SIGINT)
function ctrl_c_handler() {
echo "Script terminated by Ctrl+C"
if [ $command_pid -ne 0 ]; then
echo "Stopping the command... with PID $command_pid"
kill -SIGTERM $command_pid
fi
exit 1
}
# Trap the SIGINT signal and call the handler function
trap ctrl_c_handler SIGINT
function is_in_ignore() {
local benchmark_to_test=$1
for element in "${ignore_benchmarks[@]}"; do
if [ "$benchmark_to_test" = "$element" ]; then
return 0
fi
done
return 1
}
weave_type=$1
output_benchmark_list=$(java -cp dacapo-9.12-MR1-bach.jar Harness -l)
read -a benchmarks <<< "$output_benchmark_list"
for benchmark in "${benchmarks[@]}"; do
if is_in_ignore "$benchmark"; then
continue
else
if [ "$weave_type" = "aspectj" ]; then
echo -e "\n\nNow running $benchmark instrumented using aspectj\n===================================\n"
java -cp weaved-dacapo-9.12-MR1-bach.jar:$(pwd)/rv-monitor/target/release/rv-monitor/lib/rv-monitor-rt.jar:/usr/share/java/aspectjrt.jar Harness $benchmark &
command_pid=$!
wait $command_pid
elif [ "$weave_type" = "agent" ]; then
echo -e "\n\nNow running $benchmark instrumented using a Java agent\n===================================\n"
java -cp dacapo-9.12-MR1-bach.jar:/usr/share/java/aspectjweaver.jar:$(pwd)/rv-monitor/target/release/rv-monitor/lib/rv-monitor-rt.jar -javaagent:JavaMopAgent.jar Harness $benchmark &
command_pid=$!
wait $command_pid
else
echo "Provide the type of weaving to be used [agent, aspectj]"
echo -e "\n\nNow running $benchmark without instrumentation\n===================================\n"
java -cp dacapo-9.12-MR1-bach.jar Harness $benchmark &
fi
fi
done