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 more