From 3c0817a1b7070fe404b590bc142afada7a4ee3c7 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 5 May 2022 15:38:18 +0100 Subject: [PATCH] performance-metrics: Add boot time metrics using multiple vCPUs Signed-off-by: Rob Bradford --- performance-metrics/src/main.rs | 26 +++++++++++++++++++- performance-metrics/src/performance_tests.rs | 8 ++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/performance-metrics/src/main.rs b/performance-metrics/src/main.rs index 1b756e342..9fda1911c 100644 --- a/performance-metrics/src/main.rs +++ b/performance-metrics/src/main.rs @@ -91,6 +91,7 @@ pub struct PerformanceTestControl { queue_size: Option, net_rx: Option, fio_ops: Option, + num_boot_vcpus: Option, } impl fmt::Display for PerformanceTestControl { @@ -125,6 +126,7 @@ impl PerformanceTestControl { queue_size: None, net_rx: None, fio_ops: None, + num_boot_vcpus: Some(1), } } } @@ -216,7 +218,7 @@ mod adjuster { } } -const TEST_LIST: [PerformanceTest; 15] = [ +const TEST_LIST: [PerformanceTest; 17] = [ PerformanceTest { name: "boot_time_ms", func_ptr: performance_boot_time, @@ -237,6 +239,28 @@ const TEST_LIST: [PerformanceTest; 15] = [ }, unit_adjuster: adjuster::s_to_ms, }, + PerformanceTest { + name: "boot_time_16_vcpus_ms", + func_ptr: performance_boot_time, + control: PerformanceTestControl { + test_timeout: 2, + test_iterations: 10, + num_boot_vcpus: Some(16), + ..PerformanceTestControl::default() + }, + unit_adjuster: adjuster::s_to_ms, + }, + PerformanceTest { + name: "boot_time_16_vcpus_pmem_ms", + func_ptr: performance_boot_time_pmem, + control: PerformanceTestControl { + test_timeout: 2, + test_iterations: 10, + num_boot_vcpus: Some(16), + ..PerformanceTestControl::default() + }, + unit_adjuster: adjuster::s_to_ms, + }, PerformanceTest { name: "virtio_net_latency_us", func_ptr: performance_net_latency, diff --git a/performance-metrics/src/performance_tests.rs b/performance-metrics/src/performance_tests.rs index 37cf16f3f..5d9bc3b98 100644 --- a/performance-metrics/src/performance_tests.rs +++ b/performance-metrics/src/performance_tests.rs @@ -499,6 +499,10 @@ pub fn performance_boot_time(control: &PerformanceTestControl) -> f64 { let mut cmd = GuestCommand::new(&guest); let c = cmd + .args(&[ + "--cpus", + &format!("boot={}", control.num_boot_vcpus.unwrap_or(1)), + ]) .args(&["--memory", "size=1G"]) .args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()]) .args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE]) @@ -522,6 +526,10 @@ pub fn performance_boot_time_pmem(control: &PerformanceTestControl) -> f64 { let guest = performance_test_new_guest(Box::new(focal)); let mut cmd = GuestCommand::new(&guest); let c = cmd + .args(&[ + "--cpus", + &format!("boot={}", control.num_boot_vcpus.unwrap_or(1)), + ]) .args(&["--memory", "size=1G,hugepages=on"]) .args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()]) .args(&["--cmdline", "root=/dev/pmem0p1 console=ttyS0 quiet rw"])