mirror of
				https://github.com/edera-dev/krata.git
				synced 2025-11-03 23:29:39 +00:00 
			
		
		
		
	Power management core functionality (#217)
* feat(power-management-core): add core power management control messages for kratad Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): expose xen hypercall client publicly Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): add indexmap to kratart crate dependencies Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): implement power management core in kratart Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): bubble up runtime context in daemon/control service Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): expose performance/efficiency core data in protobuf Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): fix up some protobuf message names Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): fix up performance core heuristic Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): implement GetHostCpuTopology RPC Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): hackfix to get sysctls working with tokio Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): borrow the PowerManagementContext when calling functions belonging to it Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): remove GetHostPowerManagementPolicy RPC for now Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): implement SetHostPowerManagementPolicy RPC Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): add cpu-topology command Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * feat(power-management-core): appease format checking Signed-off-by: Ariadne Conill <ariadne@ariadne.space> * fix(runtime): cpu topology corrections --------- Signed-off-by: Ariadne Conill <ariadne@ariadne.space> Co-authored-by: Alex Zenla <alex@edera.dev>
This commit is contained in:
		
							
								
								
									
										19
									
								
								crates/xen/xencall/examples/cputopo.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								crates/xen/xencall/examples/cputopo.rs
									
									
									
									
									
										Normal 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(())
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user