lisa.energy_model.PowerDomain#
- class lisa.energy_model.PowerDomain(idle_states, cpu=None, children=None)[source]#
Bases:
Loggable
Describes the power domain hierarchy for an EnergyModel.
Power domains are a description of the topological dependencies in hardware for entering idle states. “Composite” states such as cluster-sleep states require a set of CPUs to all be idle before that state can be entered. In that case those CPUs can be grouped into a power domain, and that composite state attached to the power domain. Note that cpuidle is not aware of these dependencies; they are typically handled by the platform firmware.
Exactly one of
cpu
andchildren
must be given. That is, leaves of the PowerDomain tree always contain exactly one CPU - each CPU is represented as being in a power domain of its own. This represents the assumption that all CPUs have at least one idle state (such as ARM WFI) that they can enter independently of other CPUs.- Parameters:
idle_states (list(str)) – List of names of idle states for this power domain. Does not store power data - these names are used as keys into the
idle_states
field ofEnergyModelNode
objects.cpu (int) – The CPU this node represents. If provided, this is a leaf node.
children (list(PowerDomain)) – Non-empty list of child
PowerDomain
objects
Attributes
For convenience, this holds the single CPU contained by leaf nodes.
None
for non-leaf nodes.CPUs contained in this node. Includes those of child nodes.
Properties
logger
inheritedConvenience short-hand for
self.get_logger()
.Methods
Iterate over leaves.
Iterate over nodes depth-first, post-order.
get_logger()
inheritedProvides a
logging.Logger
named aftercls
.log_locals()
inheritedDebugging aid: log the local variables of the calling function.
Attributes#
- PowerDomain.cpu#
For convenience, this holds the single CPU contained by leaf nodes.
None
for non-leaf nodes.
- PowerDomain.cpus#
CPUs contained in this node. Includes those of child nodes.
Properties#
- property PowerDomain.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
Methods#
- PowerDomain.iter_leaves()#
Iterate over leaves
- PowerDomain.iter_nodes()#
Iterate over nodes depth-first, post-order
- classmethod PowerDomain.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- classmethod PowerDomain.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.