lisa.energy_model.LegacyEnergyModel#
- class lisa.energy_model.LegacyEnergyModel(root_node, root_power_domain, freq_domains)[source]#
Bases:
EnergyModelLegacy energy model used on Android kernels prior 4.19.
The energy model information is stored in sysfs and contains detailed information about idle states.
Warning
Arbitrary code can be executed while loading an instance from a YAML or Pickle file. To include untrusted data in YAML, use the !untrusted tag along with a string
Attributes
ATTRIBUTES_SERIALIZATIONinheritedAttributes to be treated specially during serialization.
DEFAULT_SERIALIZATION_FMTinheritedDefault format used when serializing objects.
YAML_ENCODINGinheritedEncoding used for YAML files.
capacity_scaleinheritedThe relative computational capacity of the most powerful CPU at its highest available frequency. Utilisation is in the interval
[0, capacity_scale].cpu_nodesinheritedList of leaf (CPU)
EnergyModelNode.cpusinheritedList of logical CPU numbers in the system.
Properties
biggest_cpusinheritedThe CPUs with the highest compute capacity at their highest frequency.
cpu_groupsinheritedList of lists of CPUs who share the same active state values.
is_heterogeneousinheritedTrue iff CPUs do not all have the same efficiency and OPP range.
littlest_cpusinheritedThe CPUs with the lowest compute capacity at their highest frequency.
loggerinheritedConvenience short-hand for
self.get_logger().node_groupsinheritedList of lists of CPUs nodes who share the same active state values.
Methods
Create an EnergyModel by reading a target filesystem.
Check if an
EnergyModelcan be loaded from the target.__copy__()inheritedRegular shallow copy operation, without dropping any attributes.
__getstate__()inheritedFilter the instance’s attributes upon serialization.
__setstate__()inheritedestimate_from_cpu_util()inheritedEstimate the energy usage of the system under a utilization distribution.
estimate_from_trace()inheritedEstimate the energy consumption of the system by looking at a trace.
from_path()inheritedDeserialize an object from a file.
get_cpu_capacity()inheritedConvenience method to get the capacity of a CPU at a given frequency.
get_logger()inheritedProvides a
logging.Loggernamed aftercls.get_optimal_placements()inheritedFind the optimal distribution of work for a set of tasks.
guess_freqs()inheritedWork out CPU frequencies required to execute a workload.
guess_idle_states()inheritedPessimistically guess the idle states that each CPU may enter.
log_locals()inheritedDebugging aid: log the local variables of the calling function.
to_path()inheritedSerialize the object to a file.
to_yaml()inheritedReturn a YAML string with the serialized object.
Attributes#
- LegacyEnergyModel.ATTRIBUTES_SERIALIZATION = {'allowed': [], 'ignored': [], 'placeholders': {}}#
Inherited attribute, see
lisa.utils.Serializable.ATTRIBUTES_SERIALIZATIONAttributes to be treated specially during serialization.
- LegacyEnergyModel.DEFAULT_SERIALIZATION_FMT = 'yaml'#
Inherited attribute, see
lisa.utils.Serializable.DEFAULT_SERIALIZATION_FMTDefault format used when serializing objects.
- LegacyEnergyModel.YAML_ENCODING = 'utf-8'#
Inherited attribute, see
lisa.utils.Serializable.YAML_ENCODINGEncoding used for YAML files.
- LegacyEnergyModel.capacity_scale#
Inherited attribute, see
lisa.energy_model.EnergyModel.capacity_scaleThe relative computational capacity of the most powerful CPU at its highest available frequency. Utilisation is in the interval
[0, capacity_scale].
- LegacyEnergyModel.cpu_nodes#
Inherited attribute, see
lisa.energy_model.EnergyModel.cpu_nodesList of leaf (CPU)
EnergyModelNode.
- LegacyEnergyModel.cpus#
Inherited attribute, see
lisa.energy_model.EnergyModel.cpusList of logical CPU numbers in the system.
Properties#
- property LegacyEnergyModel.biggest_cpus#
Inherited property, see
lisa.energy_model.EnergyModel.biggest_cpusThe CPUs with the highest compute capacity at their highest frequency.
- property LegacyEnergyModel.cpu_groups#
Inherited property, see
lisa.energy_model.EnergyModel.cpu_groupsList of lists of CPUs who share the same active state values.
- property LegacyEnergyModel.is_heterogeneous#
Inherited property, see
lisa.energy_model.EnergyModel.is_heterogeneousTrue iff CPUs do not all have the same efficiency and OPP range.
- property LegacyEnergyModel.littlest_cpus#
Inherited property, see
lisa.energy_model.EnergyModel.littlest_cpusThe CPUs with the lowest compute capacity at their highest frequency.
- property LegacyEnergyModel.logger#
Inherited property, see
lisa.utils.Loggable.loggerConvenience short-hand for
self.get_logger().
- property LegacyEnergyModel.node_groups#
Inherited property, see
lisa.energy_model.EnergyModel.node_groupsList of lists of CPUs nodes who share the same active state values.
Methods#
- classmethod LegacyEnergyModel.from_target(target, filename='/proc/sys/kernel/sched_domain/cpu{}/domain{}/group{}/energy/{}')[source]#
Create an EnergyModel by reading a target filesystem
This uses the sysctl added by EAS patches to exposes the cap_states and idle_states fields for each sched_group. This feature depends on CONFIG_SCHED_DEBUG, and is not upstream in mainline Linux.
The kernel doesn’t have an power domain data, so this method assumes that all CPUs are totally independent wrt. idle states - the EnergyModel constructed won’t be aware of the topological dependencies for entering “cluster” idle states.
Assumes the energy model has two-levels (plus the root) - a level for CPUs and a level for ‘clusters’.
- Parameters:
target – Devlib target object to read filesystem from. Must have cpufreq and cpuidle modules enabled.
- Returns:
Constructed EnergyModel object based on the parameters reported by the target.
- static LegacyEnergyModel.probe_target(target)[source]#
Check if an
EnergyModelcan be loaded from the target.- Parameters:
target (devlib.target.Target) – Target to look at.
- LegacyEnergyModel.__copy__()#
Inherited method, see
lisa.utils.Serializable.__copy__()Regular shallow copy operation, without dropping any attributes.
- LegacyEnergyModel.__getstate__()#
Inherited method, see
lisa.utils.Serializable.__getstate__()Filter the instance’s attributes upon serialization.
- LegacyEnergyModel.__setstate__(dct)#
Inherited method, see
lisa.utils.Serializable.__setstate__()
- LegacyEnergyModel.estimate_from_cpu_util(cpu_utils, freqs=None, idle_states=None)#
Inherited method, see
lisa.energy_model.EnergyModel.estimate_from_cpu_util()Estimate the energy usage of the system under a utilization distribution.
- LegacyEnergyModel.estimate_from_trace(trace)#
Inherited method, see
lisa.energy_model.EnergyModel.estimate_from_trace()Estimate the energy consumption of the system by looking at a trace.
- classmethod LegacyEnergyModel.from_path(filepath, fmt=None)#
Inherited method, see
lisa.utils.Serializable.from_path()Deserialize an object from a file.
- LegacyEnergyModel.get_cpu_capacity(cpu, freq=None)#
Inherited method, see
lisa.energy_model.EnergyModel.get_cpu_capacity()Convenience method to get the capacity of a CPU at a given frequency.
- classmethod LegacyEnergyModel.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()Provides a
logging.Loggernamed aftercls.
- LegacyEnergyModel.get_optimal_placements(capacities, capacity_margin_pct=0)#
Inherited method, see
lisa.energy_model.EnergyModel.get_optimal_placements()Find the optimal distribution of work for a set of tasks.
- LegacyEnergyModel.guess_freqs(cpu_utils, capacity_margin_pct=0)#
Inherited method, see
lisa.energy_model.EnergyModel.guess_freqs()Work out CPU frequencies required to execute a workload.
- LegacyEnergyModel.guess_idle_states(cpus_active)#
Inherited method, see
lisa.energy_model.EnergyModel.guess_idle_states()Pessimistically guess the idle states that each CPU may enter.
- classmethod LegacyEnergyModel.log_locals(var_names=None, level='debug')#
Inherited method, see
lisa.utils.Loggable.log_locals()Debugging aid: log the local variables of the calling function.
- LegacyEnergyModel.to_path(filepath, fmt=None)#
Inherited method, see
lisa.utils.Serializable.to_path()Serialize the object to a file.
- LegacyEnergyModel.to_yaml()#
Inherited method, see
lisa.utils.Serializable.to_yaml()Return a YAML string with the serialized object.