lisa.wlgen.rta.WloadPropertyBase#
- class lisa.wlgen.rta.WloadPropertyBase[source]#
Bases:
ConcretePropertyBase
Phase workload.
Workloads are a sequence of rt-app events such as
run
.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.OPTIMIZE_JSON_KEYS
inheritedConfiguration driving the JSON optimization, as a
dict(str, set(str))
.REQUIRED_KCONFIG_KEYS
inheritedList of KCONFIG keys that need to be =Y on the target kernel for this property to be usable.
Properties
Value “payload” of the property.
key
inheritedKey of the instance.
logger
inheritedConvenience short-hand for
self.get_logger()
.Methods
Adding two workloads together concatenates them.
Replicate the given workload
n
times.HASH_COERCE()
inheritedUsed to coerce the values of
self.__dict__
to hashable values.__and__()
inheritedCombine two instances of the same property together.
check_kconfig()
inheritedCheck whether
plat_info
contains the kernel KCONFIG keys contained inREQUIRED_KCONFIG_KEYS
.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.
to_default_json()
inheritedSimilar to
to_json()
but returns the default values for the keys set into_json()
.to_json()
inheritedSnippet of JSON content for that property as Python objects.
Classes#
- WloadPropertyBase.__class__#
alias of
PropertyMeta
Attributes#
- WloadPropertyBase.JSON_KEY = 'events'#
- WloadPropertyBase.KEY = 'wload'#
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
.
- WloadPropertyBase.OPTIMIZE_JSON_KEYS = {}#
Inherited attribute, see
lisa.wlgen.rta.ConcretePropertyBase.OPTIMIZE_JSON_KEYS
Configuration driving the JSON optimization, as a
dict(str, set(str))
.
- WloadPropertyBase.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 WloadPropertyBase.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 WloadPropertyBase.key#
Inherited property, see
lisa.wlgen.rta.PropertyBase.key
Key of the instance.
- property WloadPropertyBase.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
Methods#
- WloadPropertyBase.__add__(other)[source]#
Adding two workloads together concatenates them.
Note
Any subclass implementation of
__add__
must be associative, i.e.a+(b+c) == (a+b)+c
. This property is relied on.
- WloadPropertyBase.HASH_COERCE(x, coerce)#
Inherited method, see
lisa.utils.SimpleHash.HASH_COERCE()
Used to coerce the values of
self.__dict__
to hashable values.
- abstract WloadPropertyBase.__and__(other)#
Inherited method, see
lisa.wlgen.rta.PropertyBase.__and__()
Combine two instances of the same property together.
- classmethod WloadPropertyBase.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 inREQUIRED_KCONFIG_KEYS
.
- classmethod WloadPropertyBase.find_cls(key)#
Inherited method, see
lisa.wlgen.rta.PropertyBase.find_cls()
Find which subclass can handle
key
.
- classmethod WloadPropertyBase.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 WloadPropertyBase.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- classmethod WloadPropertyBase.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 WloadPropertyBase.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 into_json()
.
- WloadPropertyBase.to_json(plat_info, **kwargs)#
Inherited method, see
lisa.wlgen.rta.ConcretePropertyBase.to_json()
Snippet of JSON content for that property as Python objects.