Skip to content

Commit 2029a08

Browse files
committed
Use BootTimer to measure hotplug latency
Change the boot timer timestamp to be public, so that the timer can also be used for measuring hotplugging Signed-off-by: James Curtis <[email protected]>
1 parent a541725 commit 2029a08

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/vmm/src/devices/pseudo/boot_timer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const MAGIC_VALUE_SIGNAL_GUEST_BOOT_COMPLETE: u8 = 123;
1010
/// Pseudo device to record the kernel boot time.
1111
#[derive(Debug)]
1212
pub struct BootTimer {
13-
start_ts: TimestampUs,
13+
pub start_ts: TimestampUs,
1414
}
1515

1616
impl BootTimer {

src/vmm/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,14 @@ impl Vmm {
683683

684684
self.acpi_device_manager.notify_cpu_container()?;
685685

686+
#[cfg(test)]
687+
if let Some(devices::BusDevice::BootTimer(timer)) =
688+
self.get_bus_device(DeviceType::BootTimer, "BootTimer")
689+
{
690+
let mut locked_timer = timer.lock().expect("Poisoned lock");
691+
locked_timer.start_ts = utils::time::TimestampUs::default();
692+
}
693+
686694
Ok(new_machine_config)
687695
}
688696

0 commit comments

Comments
 (0)