-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathrun_microbench.sh
More file actions
executable file
·32 lines (22 loc) · 1.08 KB
/
run_microbench.sh
File metadata and controls
executable file
·32 lines (22 loc) · 1.08 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
#!/bin/bash
# Requires lind-boot to be built with the `lind_perf` feature.
# Use `make lind-boot-perf` for this.
set -euo pipefail
# Check if we need to re-exec with sudo
if [[ $EUID -ne 0 ]]; then
# Not running as root, re-exec with sudo
exec sudo -E "$0" "$@"
fi
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="${SCRIPT_DIR%scripts}"
BENCH_ROOT="${REPO_ROOT}/tests/benchmarks"
echo "Compiling Tests..."
"${SCRIPT_DIR}/lind_compile" "${BENCH_ROOT}/libc_syscall.c" &>/dev/null && mv "${BENCH_ROOT}/libc_syscall.wasm" "${REPO_ROOT}/lindfs/"
"${SCRIPT_DIR}/lind_compile" "${BENCH_ROOT}/fdtables_syscall.c" &>/dev/null && mv "${BENCH_ROOT}/fdtables_syscall.wasm" "${REPO_ROOT}/lindfs/"
"${SCRIPT_DIR}/lind_compile" --compile-grate "${BENCH_ROOT}/grate_syscall.c" &>/dev/null && mv "${BENCH_ROOT}/grate_syscall.wasm" "${REPO_ROOT}/lindfs/"
echo -en "\nLIBC Test\t"
sudo lind-boot --perf libc_syscall.wasm
echo -en "\nFDTABLE Test\t"
sudo lind-boot --perf fdtables_syscall.wasm
echo -en "\nGRATE Test\t"
sudo lind-boot --perf grate_syscall.wasm libc_syscall.wasm