-
Notifications
You must be signed in to change notification settings - Fork 81
/
run.sh
executable file
·43 lines (31 loc) · 1.21 KB
/
run.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
#!/usr/bin/env bash
set -o errexit
netbench_dir="${0%/*}"
root_dir="$netbench_dir"/../..
rusty_loader_dir="$root_dir"/../rusty-loader
bin=$2
args="--bytes 1048576 --rounds 1"
hermit() {
echo "Building rusty-loader"
make -C "$rusty_loader_dir" release=1
echo "Building $bin image"
RUSTFLAGS="-Clinker-plugin-lto" cargo build --manifest-path "$netbench_dir"/Cargo.toml --bin $bin \
--release
echo "Launching $bin image on QEMU"
qemu-system-x86_64 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr \
-enable-kvm -display none -smp 1 -m 1G -serial stdio \
-kernel "$rusty_loader_dir"/target/x86_64-unknown-hermit-loader/release/rusty-loader \
-initrd "$root_dir"/target/x86_64-unknown-hermit/release/$bin \
-netdev tap,id=net0,ifname=tap10,script=no,downscript=no,vhost=on \
-device virtio-net-pci,netdev=net0,disable-legacy=on \
-append "-- --nonblocking 0 --address 10.0.5.1 $args"
}
linux() {
echo "Launching $bin on linux"
cargo run --manifest-path "$netbench_dir"/Cargo.toml --bin $bin \
--release \
--target x86_64-unknown-linux-gnu \
-- \
--nonblocking 0 --address 10.0.5.3 $args
}
$1