mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 10:23:23 +00:00
Add tcp latency test over virtio-net
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
e78303b01a
commit
090149eed7
21
test/benchmark/lmbench/tcp_virtio_lat/host.sh
Normal file
21
test/benchmark/lmbench/tcp_virtio_lat/host.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
set -e
|
||||
|
||||
# Function to stop the guest VM
|
||||
stop_guest() {
|
||||
echo "Stopping guest VM..."
|
||||
# `-r` means if there's no qemu, the kill won't be executed
|
||||
pgrep qemu | xargs -r kill
|
||||
}
|
||||
|
||||
# Trap EXIT signal to ensure guest VM is stopped on script exit
|
||||
trap stop_guest EXIT
|
||||
|
||||
# Run lmbench tcp client
|
||||
echo "Running lmbench tcp client"
|
||||
/usr/local/benchmark/lmbench/lat_tcp -P 1 127.0.0.1
|
||||
|
||||
# The trap will automatically stop the guest VM when the script exits
|
Reference in New Issue
Block a user