lisa.wlgen.rta.ComposableMultiConcretePropertyBase#

class lisa.wlgen.rta.ComposableMultiConcretePropertyBase(**kwargs)[source]#

Bases: MultiConcreteProperty

Base class for properties that are a collection of values.

Variable keyword arguments:

attributes to set on the instance.

Classes

__class__ inherited

Metaclass for properties.

Attributes

KEY

Subclasses can override this attribute so that PropertyBase.from_key() knows that it can call their _from_key() method for that key.

DEFAULT_JSON inherited

OPTIMIZE_JSON_KEYS inherited

Configuration driving the JSON optimization, as a dict(str, set(str)).

REQUIRED_KCONFIG_KEYS inherited

List of KCONFIG keys that need to be =Y on the target kernel for this property to be usable.

Properties

val

Value “payload” of the property.

key inherited

Key of the instance.

logger inherited

Convenience short-hand for self.get_logger().

Methods

__and__()

Combine two instances of the same property together.

__getattr__()

Lookup the attributes values defined in _ATTRIBUTES.

__init_subclass__()

Update the docstring used as a str.format() template with the following keys:.

from_product()

To be called the same way as the class itself, except that all values are expected to be iterables and the class will be called with all combinations, returning a list of instances.

HASH_COERCE() inherited

Used to coerce the values of self.__dict__ to hashable values.

check_kconfig() inherited

Check whether plat_info contains the kernel KCONFIG keys contained in REQUIRED_KCONFIG_KEYS.

find_cls() inherited

Find which subclass can handle key.

from_key() inherited

Alternative constructor that is available with the same signature for all properties.

get_logger() inherited

Provides a logging.Logger named after cls.

log_locals() inherited

Debugging aid: log the local variables of the calling function.

to_default_json() inherited

Similar to to_json() but returns the default values for the keys set in to_json().

to_json() inherited

Snippet of JSON content for that property as Python objects.

Classes#

ComposableMultiConcretePropertyBase.__class__#

alias of PropertyMeta

Attributes#

ComposableMultiConcretePropertyBase.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.

ComposableMultiConcretePropertyBase.DEFAULT_JSON = None#
ComposableMultiConcretePropertyBase.OPTIMIZE_JSON_KEYS = {}#

Inherited attribute, see lisa.wlgen.rta.ConcretePropertyBase.OPTIMIZE_JSON_KEYS

Configuration driving the JSON optimization, as a dict(str, set(str)).

ComposableMultiConcretePropertyBase.REQUIRED_KCONFIG_KEYS = []#

Inherited attribute, see lisa.wlgen.rta.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 ComposableMultiConcretePropertyBase.val[source]#

Value “payload” of the property.

Ideally, it should be a valid value that can be given to from_key(), but it’s not mandatory. For complex properties that are not isomorphic to a Python basic type (int, tuple etc.), self should be returned.

property ComposableMultiConcretePropertyBase.key#

Inherited property, see lisa.wlgen.rta.PropertyBase.key

Key of the instance.

property ComposableMultiConcretePropertyBase.logger#

Inherited property, see lisa.utils.Loggable.logger

Convenience short-hand for self.get_logger().

Methods#

ComposableMultiConcretePropertyBase.__and__(other)[source]#

Combine two instances of the same property together.

This is used to combine properties at the various levels of the RTAPhaseTree tree, on each path from the root to the leaves. It is guaranteed that the instance closer to the root will be self and the one closer to the leaves will be other.

If the property is a constraint, a good implementation should combine two instances by applying the strongest constraint. For example, CPU affinity are combined by taking the intersection of allowed CPUs.

If the property is some sort of “dummy” structure, it can make sense to allow the instance closer to the root of the tree to override the set members in the instance closer to the leaves.

Otherwise, it’s probably best to just bail with ValueError with a message explaining that there is a conflict.

ComposableMultiConcretePropertyBase.__getattr__(attr)[source]#

Lookup the attributes values defined in _ATTRIBUTES.

classmethod ComposableMultiConcretePropertyBase.__init_subclass__(**kwargs)[source]#

Update the docstring used as a str.format() template with the following keys:

  • {params}: replaced by the Sphinx-friendly list of attributes

classmethod ComposableMultiConcretePropertyBase.from_product(**kwargs)[source]#

To be called the same way as the class itself, except that all values are expected to be iterables and the class will be called with all combinations, returning a list of instances.

ComposableMultiConcretePropertyBase.HASH_COERCE(x, coerce)#

Inherited method, see lisa.utils.SimpleHash.HASH_COERCE()

Used to coerce the values of self.__dict__ to hashable values.

classmethod ComposableMultiConcretePropertyBase.check_kconfig(plat_info, strict=True)#

Inherited method, see lisa.wlgen.rta.ConcretePropertyBase.check_kconfig()

Check whether plat_info contains the kernel KCONFIG keys contained in REQUIRED_KCONFIG_KEYS.

classmethod ComposableMultiConcretePropertyBase.find_cls(key)#

Inherited method, see lisa.wlgen.rta.PropertyBase.find_cls()

Find which subclass can handle key.

classmethod ComposableMultiConcretePropertyBase.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 ComposableMultiConcretePropertyBase.get_logger(suffix=None)#

Inherited method, see lisa.utils.Loggable.get_logger()

Provides a logging.Logger named after cls.

classmethod ComposableMultiConcretePropertyBase.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.

classmethod ComposableMultiConcretePropertyBase.to_default_json(plat_info, properties)#

Inherited method, see lisa.wlgen.rta.ConcretePropertyBase.to_default_json()

Similar to to_json() but returns the default values for the keys set in to_json().

ComposableMultiConcretePropertyBase.to_json(plat_info, **kwargs)#

Inherited method, see lisa.wlgen.rta.ConcretePropertyBase.to_json()

Snippet of JSON content for that property as Python objects.