mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
performance-metrics: enable fio test on AArch64
fio test depends on hot-add disk which needs uefi on AArch64, that will lead to lots of performance issues. So, it's better to use cold-plug disk. Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
parent
4335e5f84c
commit
1b494fb061
@ -17,7 +17,10 @@ use test_infra::Error as InfraError;
|
||||
use test_infra::*;
|
||||
use wait_timeout::ChildExt;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub const FOCAL_IMAGE_NAME: &str = "focal-server-cloudimg-amd64-custom-20210609-0.raw";
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub const FOCAL_IMAGE_NAME: &str = "focal-server-cloudimg-arm64-custom-20210929-0-update-tool.raw";
|
||||
|
||||
#[derive(Debug)]
|
||||
enum WaitTimeoutError {
|
||||
@ -618,7 +621,6 @@ fn parse_fio_output(output: &str, fio_ops: &FioOps, num_jobs: u32) -> Result<f64
|
||||
pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
|
||||
let test_timeout = control.test_timeout;
|
||||
let num_queues = control.num_queues.unwrap();
|
||||
let queue_size = control.queue_size.unwrap();
|
||||
let fio_ops = control.fio_ops.as_ref().unwrap();
|
||||
|
||||
let focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
|
||||
@ -636,7 +638,20 @@ pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
|
||||
.args(&["--memory", "size=4G"])
|
||||
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
||||
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
||||
.default_disks()
|
||||
.args(&[
|
||||
"--disk",
|
||||
format!(
|
||||
"path={}",
|
||||
guest.disk_config.disk(DiskType::OperatingSystem).unwrap()
|
||||
)
|
||||
.as_str(),
|
||||
format!(
|
||||
"path={}",
|
||||
guest.disk_config.disk(DiskType::CloudInit).unwrap()
|
||||
)
|
||||
.as_str(),
|
||||
format!("path={}", BLK_IO_TEST_IMG).as_str(),
|
||||
])
|
||||
.default_net()
|
||||
.args(&["--api-socket", &api_socket])
|
||||
.capture_output()
|
||||
@ -647,25 +662,6 @@ pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
guest.wait_vm_boot(None).unwrap();
|
||||
|
||||
// Hotplug test disk
|
||||
assert!(Command::new(clh_command("ch-remote"))
|
||||
.args(&[&format!("--api-socket={}", api_socket)])
|
||||
.args(&[
|
||||
"add-disk",
|
||||
&format!(
|
||||
"path={},num_queues={},queue_size={},direct=on",
|
||||
BLK_IO_TEST_IMG, num_queues, queue_size
|
||||
)
|
||||
])
|
||||
.stderr(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait_timeout(Duration::from_secs(5))
|
||||
.unwrap()
|
||||
.expect("Failed to hotplug test disk image")
|
||||
.success());
|
||||
|
||||
let fio_command = format!(
|
||||
"sudo fio --filename=/dev/vdc --name=test --output-format=json \
|
||||
--direct=1 --bs=4k --ioengine=io_uring --iodepth=64 \
|
||||
|
Loading…
Reference in New Issue
Block a user