lisa.wlgen.rta.ConcretePropertyBase#
- class lisa.wlgen.rta.ConcretePropertyBase[source]#
Bases:
PropertyBase
,Loggable
Base class for concrete properties.
Concrete properties are properties that will ultimately translated into JSON, as opposed to meta properties that will never make it to the final configuration file.
Classes
__class__
inheritedMetaclass for properties.
Attributes
Subclasses can override this attribute so that
PropertyBase.from_key()
knows that it can call their_from_key()
method for that key.Configuration driving the JSON optimization, as a
dict(str, set(str))
.List of KCONFIG keys that need to be =Y on the target kernel for this property to be usable.
Properties
key
inheritedKey of the instance.
logger
inheritedConvenience short-hand for
self.get_logger()
.val
inheritedValue “payload” of the property.
Methods
Check whether
plat_info
contains the kernel KCONFIG keys contained inREQUIRED_KCONFIG_KEYS
.Similar to
to_json()
but returns the default values for the keys set into_json()
.Snippet of JSON content for that property as Python objects.
HASH_COERCE()
inheritedUsed to coerce the values of
self.__dict__
to hashable values.__and__()
inheritedCombine two instances of the same property together.
find_cls()
inheritedFind which subclass can handle
key
.from_key()
inheritedAlternative constructor that is available with the same signature for all properties.
get_logger()
inheritedProvides a
logging.Logger
named aftercls
.log_locals()
inheritedDebugging aid: log the local variables of the calling function.
Classes#
- ConcretePropertyBase.__class__#
alias of
PropertyMeta
Attributes#
- ConcretePropertyBase.KEY = None#
Subclasses can override this attribute so that
PropertyBase.from_key()
knows that it can call their_from_key()
method for that key.Note
This class attribute will not be inherited automatically so that each class can be uniquely identified by its key. Subclass that do not override the value explicitly will get
None
.
- ConcretePropertyBase.OPTIMIZE_JSON_KEYS = {}#
Configuration driving the JSON optimization, as a
dict(str, set(str))
.This is a dictionary mapping JSON key names to set of “barrier” JSON keys. When successive phases of a given task share the same value for the keys of that dictionary, they will be removed in the later phases since rt-app settings are persistent across phases. When any of the barrier key listed in the set has a change in its value, it will be considered as an optimization barrier and the value will be set again, even if it means repeating the same value as earlier.
- ConcretePropertyBase.REQUIRED_KCONFIG_KEYS = []#
List of KCONFIG keys that need to be =Y on the target kernel for this property to be usable.
Properties#
- property ConcretePropertyBase.key#
Inherited property, see
lisa.wlgen.rta.PropertyBase.key
Key of the instance.
- property ConcretePropertyBase.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
- abstract property ConcretePropertyBase.val#
Inherited property, see
lisa.wlgen.rta.PropertyBase.val
Value “payload” of the property.
Methods#
- classmethod ConcretePropertyBase.check_kconfig(plat_info, strict=True)[source]#
Check whether
plat_info
contains the kernel KCONFIG keys contained inREQUIRED_KCONFIG_KEYS
.
- classmethod ConcretePropertyBase.to_default_json(plat_info, properties)[source]#
Similar to
to_json()
but returns the default values for the keys set into_json()
.- Parameters:
plat_info (lisa.platforms.platinfo.PlatformInfo) – Platform information that can be used to generate the default value .
properties (collections.OrderedDict(str, object)) –
collections.OrderedDict
of JSON properties for the current phase. This can be used if the default value is context dependent. For example, if two properties depend on each other, they can get the value of the other key fromproperties
. The property might not have been set yet so abscence of the key has to be handled. The calling code will look for a fixpoint for the default properties, so this method will be called iteratively until the result is stable, allowing for arbitrary dependency between keys.
- ConcretePropertyBase.to_json(plat_info, **kwargs)[source]#
Snippet of JSON content for that property as Python objects.
- Parameters:
plat_info (lisa.platforms.platinfo.PlatformInfo) – Platform information that can be used to generate the default value .
- ConcretePropertyBase.HASH_COERCE(x, coerce)#
Inherited method, see
lisa.utils.SimpleHash.HASH_COERCE()
Used to coerce the values of
self.__dict__
to hashable values.
- abstract ConcretePropertyBase.__and__(other)#
Inherited method, see
lisa.wlgen.rta.PropertyBase.__and__()
Combine two instances of the same property together.
- classmethod ConcretePropertyBase.find_cls(key)#
Inherited method, see
lisa.wlgen.rta.PropertyBase.find_cls()
Find which subclass can handle
key
.
- classmethod ConcretePropertyBase.from_key(key, val)#
Inherited method, see
lisa.wlgen.rta.PropertyBase.from_key()
Alternative constructor that is available with the same signature for all properties.
- classmethod ConcretePropertyBase.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- classmethod ConcretePropertyBase.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.