pub struct PowerLevelDomainJson {
pub power_domain: PowerDomain,
pub power_levels: Vec<PowerLevel>,
pub power_level_transitions: Vec<PowerLevelTransition>,
}
Expand description
This library is used to parse a processor energy model JSON file into a data structure which also implements some convenience methods for accessing and consuming the data.
The intended usage is that EnergyModel::new()
is called with an energy model JSON file path.
If successful, the function returns an EnergyModel instance containing the parsed config data.
The parser expects a JSON5 file of the following format: [ { power_domain: { cpu_set: [ 1, 2, 3, ], domain_id: 0, }, power_levels: [ { processing_rate: 200, power_coefficient_nw: 100, control_interface: ‘CpuDriver’, control_argument: 0, diagnostic_name: ‘Pstate 0’, }, { processing_rate: 100, power_coefficient_nw: 50, control_interface: ‘CpuDriver’, control_argument: 0, diagnostic_name: ‘Pstate 1’, }, ], power_level_transitions: [ { from: 0, to: 1, duration_ns: 100, energy_nj: 100, }, ], }, { power_domain: { cpu_set: [ 0, 4, ], domain_id: 1, }, power_levels: { option: ‘DomainIndependent’, processing_rate: 200, power_coefficient_nw: 200, control_interface: ‘CpuDriver’, control_argument: 0, diagnostic_name: ‘Pstate 0’, }, power_level_transitions: [ ], }, ] Defines a Json compatible energy model struct of a specific set of CPUs.
Fields§
§power_domain: PowerDomain
§power_levels: Vec<PowerLevel>
§power_level_transitions: Vec<PowerLevelTransition>
Implementations§
Trait Implementations§
Source§impl Clone for PowerLevelDomainJson
impl Clone for PowerLevelDomainJson
Source§fn clone(&self) -> PowerLevelDomainJson
fn clone(&self) -> PowerLevelDomainJson
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PowerLevelDomainJson
impl Debug for PowerLevelDomainJson
Source§impl<'de> Deserialize<'de> for PowerLevelDomainJson
impl<'de> Deserialize<'de> for PowerLevelDomainJson
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PowerLevelDomainJson
impl PartialEq for PowerLevelDomainJson
impl StructuralPartialEq for PowerLevelDomainJson
Auto Trait Implementations§
impl Freeze for PowerLevelDomainJson
impl RefUnwindSafe for PowerLevelDomainJson
impl Send for PowerLevelDomainJson
impl Sync for PowerLevelDomainJson
impl Unpin for PowerLevelDomainJson
impl UnwindSafe for PowerLevelDomainJson
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)