-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbench.sh
executable file
·139 lines (117 loc) · 3.53 KB
/
bench.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
# Extra DaisyNFS/GoJournal commit combinations can be tried by passing extra
# arguments after the first. For example,
#
# > ./bench.sh 1 abc123,xyz456 def123,master
#
# Will, in addition to the standard battery of tests, also run DaisyNFS with
# commit abc123 using GoJournal with commit xyz456 and
# DaisyNFS with commit def123 and go-journal master.
# run various performance benchmarks
set -eu
blue=$(tput setaf 4 || echo)
reset=$(tput sgr0 || echo)
info() {
echo -e "${blue}$1${reset}" 1>&2
}
if [ ! -d "$DAISY_NFSD_PATH" ]; then
echo "DAISY_NFSD_PATH is unset" 1>&2
exit 1
fi
if [ ! -d "$GO_NFSD_PATH" ]; then
echo "GO_NFSD_PATH is unset" 1>&2
exit 1
fi
if [ ! -d "$GO_JRNL_PATH" ]; then
echo "GO_JRNL_PATH is unset" 1>&2
exit 1
fi
if [ ! -d "$XV6_PATH" ]; then
echo "XV6_PATH is unset" 1>&2
exit 1
fi
usage() {
echo "Usage: $0 [-o | --output OUTFILE]" 1>&2
}
output_file="$DAISY_NFSD_PATH/eval/data/bench-raw.txt"
while [[ "$#" -gt 0 ]]; do
case "$1" in
-o | --output)
shift
output_file="$1"
shift
;;
-help | --help)
usage
exit 0
;;
-*)
echo "Unknown option $1" 1>&2
usage
exit 0
;;
*)
break
;;
esac
done
output_file=$(realpath "$output_file")
startthreads=1
threads=10
if [[ $# -gt 0 ]]; then
threads="$1"
fi
info "Using $threads threads"
shift
cd "$GO_NFSD_PATH"
go build ./cmd/fs-smallfile
go build ./cmd/fs-largefile
if [[ $# -gt 0 ]]; then
for var in "$@"; do
echo 1>&2
IFS="," read -r dnfsver goosever <<<"$var"
info "DaisyNFS-$dnfsver-$goosever"
info "Assuming DaisyNFS is using $GO_JRNL_PATH for GoJournal"
cd "$GO_JRNL_PATH"
git checkout "$goosever" --quiet
cd "$DAISY_NFSD_PATH"
git checkout "$dnfsver" --quiet
go mod edit -replace github.com/mit-pdos/go-journal="$GO_JRNL_PATH"
echo "fs=dfns-$dnfsver-$goosever"
./bench/run-daisy-nfsd.sh "$GO_NFSD_PATH"/fs-smallfile -start="$startthreads" -threads="$threads"
./bench/run-daisy-nfsd.sh "$GO_NFSD_PATH"/fs-largefile
./bench/run-daisy-nfsd.sh "$GO_NFSD_PATH"/bench/app-bench.sh "$XV6_PATH" /mnt/nfs
done
cd "$DAISY_NFSD_PATH"
go mod edit -dropreplace github.com/mit-pdos/go-journal
git checkout main --quiet
cd "$GO_JRNL_PATH"
git checkout master --quiet
fi
cd "$DAISY_NFSD_PATH"
do_eval() {
echo 1>&2
info "DaisyNFS"
echo "fs=dnfs"
./bench/run-daisy-nfsd.sh -disk "" "$GO_NFSD_PATH"/fs-smallfile -start="$startthreads" -threads="$threads"
./bench/run-daisy-nfsd.sh -disk "" "$GO_NFSD_PATH"/fs-largefile
./bench/run-daisy-nfsd.sh -disk "" "$GO_NFSD_PATH"/bench/app-bench.sh "$XV6_PATH" /mnt/nfs
cd "$GO_NFSD_PATH"
echo 1>&2
info "GoNFS"
echo "fs=gonfs"
./bench/run-go-nfsd.sh -disk "" "$GO_NFSD_PATH"/fs-smallfile -start="$startthreads" -threads="$threads"
./bench/run-go-nfsd.sh -disk "" "$GO_NFSD_PATH"/fs-largefile
./bench/run-go-nfsd.sh -disk "" "$GO_NFSD_PATH"/bench/app-bench.sh "$XV6_PATH" /mnt/nfs
echo 1>&2
info "Linux ext4 over NFS"
echo "fs=linux"
./bench/run-linux.sh "$GO_NFSD_PATH"/fs-smallfile -start="$startthreads" -threads="$threads"
./bench/run-linux.sh "$GO_NFSD_PATH"/fs-largefile
./bench/run-linux.sh "$GO_NFSD_PATH"/bench/app-bench.sh "$XV6_PATH" /mnt/nfs
}
if [ "$output_file" = "-" ]; then
do_eval
else
do_eval | tee "$output_file"
fi