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

OPTIMIZE_JSON_KEYS

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

REQUIRED_KCONFIG_KEYS

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

Properties

key inherited

Key of the instance.

logger inherited

Convenience short-hand for self.get_logger().

val inherited

Value “payload” of the property.

Methods

check_kconfig()

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

to_default_json()

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

to_json()

Snippet of JSON content for that property as Python objects.

HASH_COERCE() inherited

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

__and__() inherited

Combine two instances of the same property together.

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.

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 in REQUIRED_KCONFIG_KEYS.

Parameters:
  • keys (list(str)) – Kernel config keys to check, e.g. [‘CONFIG_FOO_BAR’].

  • strict (bool) – If True, raise an exception if any key is missing. If False, log if any key is missing.

classmethod ConcretePropertyBase.to_default_json(plat_info, properties)[source]#

Similar to to_json() but returns the default values for the keys set in to_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 from properties. 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 after cls.

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.