feature(xen): implement power management operations (#215)

This commit is contained in:
Alex Zenla
2024-06-28 15:13:57 -07:00
committed by GitHub
parent 0f49d0cec4
commit b42b730b77
5 changed files with 287 additions and 3 deletions

View File

@ -0,0 +1,19 @@
use xencall::error::Result;
use xencall::sys::CpuId;
use xencall::XenCall;
#[tokio::main]
async fn main() -> Result<()> {
env_logger::init();
let call = XenCall::open(0)?;
let physinfo = call.phys_info().await?;
println!("{:?}", physinfo);
let topology = call.cpu_topology().await?;
println!("{:?}", topology);
call.set_cpufreq_gov(CpuId::All, "performance").await?;
call.set_cpufreq_gov(CpuId::Single(0), "performance")
.await?;
call.set_turbo_mode(CpuId::All, true).await?;
Ok(())
}