MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / init_pmu

Method init_pmu

vmm/src/cpu.rs:1104–1120  ·  view source on GitHub ↗
(&self, irq: u32)

Source from the content-addressed store, hash-verified

1102
1103 #[cfg(target_arch = "aarch64")]
1104 pub fn init_pmu(&self, irq: u32) -> Result<bool> {
1105 for cpu in self.vcpus.iter() {
1106 let cpu = cpu.lock().unwrap();
1107 // Check if PMU attr is available, if not, log the information.
1108 if cpu.vcpu.has_pmu_support() {
1109 cpu.vcpu.init_pmu(irq).map_err(Error::InitPmu)?;
1110 } else {
1111 debug!(
1112 "PMU attribute is not supported in vCPU{}, skip PMU init!",
1113 cpu.id
1114 );
1115 return Ok(false);
1116 }
1117 }
1118
1119 Ok(true)
1120 }
1121
1122 pub fn vcpus(&self) -> Vec<Arc<Mutex<Vcpu>>> {
1123 self.vcpus.clone()

Callers 2

configure_systemMethod · 0.45

Calls 2

iterMethod · 0.80
has_pmu_supportMethod · 0.45

Tested by

no test coverage detected