lisa.wlgen.rta.PeriodicWload#
- class lisa.wlgen.rta.PeriodicWload(**kwargs)[source]#
Bases:
WloadPropertyBase,ComposableMultiConcretePropertyBasePeriodic task workload.
The task runs to complete a given amount of work, then sleeps until the end of the period.
- Parameters:
duty_cycle_pct (float or None) – Duty cycle of the task in percents (when executing on the fastest CPU at max frequency). This is effectively equivalent to an amount of work.
period (float or None) – Period of the activation pattern in seconds
duration (float or None) – Duration of the workload in seconds.
scale_for_cpu (int or None) – CPU ID used to scale the
duty_cycle_pctvalue on asymmetric systems. IfNone, it will be assumed to be the fastest CPU on the system.scale_for_freq (int or None) – Frequency used to scale
duty_cycle_pctin a similar way toscale_for_cpu. This is only valid in conjunction withscale_for_cpu.run_wload (collections.abc.Callable or None) – Workload factory callback used for the running part. It will be called with a single
durationparameter (in seconds) and must return aWloadPropertyBase. Note that the passed duration is scaled according toscale_for_cpuandscale_for_freqsleep_wload (collections.abc.Callable or None) – Workload factory callback used for the sleeping part. It will be called with a
durationparameter andperiodparameter (in seconds) and must return aWloadPropertyBase. Note that the passed duration is scaled according toscale_for_cpuandscale_for_freqguaranteed_time (str or None) – Chooses the default ‘sleep_wload’. Can be ‘period’ (guarantee the period is fixed regardless of preemption) or ‘sleep’ (guarantee the time spent sleeping, stretching the period if the task is preempted)
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.DEFAULT_JSONinheritedJSON_KEYinheritedOPTIMIZE_JSON_KEYSinheritedConfiguration driving the JSON optimization, as a
dict(str, set(str)).REQUIRED_KCONFIG_KEYSinheritedList of KCONFIG keys that need to be =Y on the target kernel for this property to be usable.
Properties
keyinheritedKey of the instance.
loggerinheritedConvenience short-hand for
self.get_logger().valinheritedValue “payload” of the property.
Methods
Update the docstring used as a
str.format()template with the following keys:.HASH_COERCE()inheritedUsed to coerce the values of
self.__dict__to hashable values.__add__()inheritedAdding two workloads together concatenates them.
__and__()inheritedCombine two instances of the same property together.
__await__()inherited__getattr__()inheritedLookup the attributes values defined in
_ATTRIBUTES.__mul__()inheritedReplicate the given workload
ntimes.__rmul__()inheritedcheck_kconfig()inheritedCheck whether
plat_infocontains 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.
from_product()inheritedTo 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.
get_logger()inheritedProvides a
logging.Loggernamed 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#
- PeriodicWload.__class__#
alias of
PropertyMeta
Attributes#
- PeriodicWload.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.
- PeriodicWload.DEFAULT_JSON = None#
- PeriodicWload.JSON_KEY = 'events'#
- PeriodicWload.OPTIMIZE_JSON_KEYS = {}#
Inherited attribute, see
lisa.wlgen.rta.ConcretePropertyBase.OPTIMIZE_JSON_KEYSConfiguration driving the JSON optimization, as a
dict(str, set(str)).
- PeriodicWload.REQUIRED_KCONFIG_KEYS = []#
Inherited attribute, see
lisa.wlgen.rta.ConcretePropertyBase.REQUIRED_KCONFIG_KEYSList of KCONFIG keys that need to be =Y on the target kernel for this property to be usable.
Properties#
- property PeriodicWload.key#
Inherited property, see
lisa.wlgen.rta.PropertyBase.keyKey of the instance.
- property PeriodicWload.logger#
Inherited property, see
lisa.utils.Loggable.loggerConvenience short-hand for
self.get_logger().
- property PeriodicWload.val#
Inherited property, see
lisa.wlgen.rta.WloadPropertyBase.valValue “payload” of the property.
Methods#
- classmethod PeriodicWload.__init_subclass__(**kwargs)#
Update the docstring used as a
str.format()template with the following keys:{params}: replaced by the Sphinx-friendly list of attributes
- PeriodicWload.HASH_COERCE(x, coerce)#
Inherited method, see
lisa.utils.SimpleHash.HASH_COERCE()Used to coerce the values of
self.__dict__to hashable values.
- PeriodicWload.__add__(other)#
Inherited method, see
lisa.wlgen.rta.WloadPropertyBase.__add__()Adding two workloads together concatenates them.
- PeriodicWload.__and__(other)#
Inherited method, see
lisa.wlgen.rta.ComposableMultiConcretePropertyBase.__and__()Combine two instances of the same property together.
- PeriodicWload.__await__()#
Inherited method, see
lisa.wlgen.rta.WloadPropertyBase.__await__()
- PeriodicWload.__getattr__(attr)#
Inherited method, see
lisa.wlgen.rta.ComposableMultiConcretePropertyBase.__getattr__()Lookup the attributes values defined in
_ATTRIBUTES.
- PeriodicWload.__mul__(n)#
Inherited method, see
lisa.wlgen.rta.WloadPropertyBase.__mul__()Replicate the given workload
ntimes.
- PeriodicWload.__rmul__(n)#
Inherited method, see
lisa.wlgen.rta.WloadPropertyBase.__rmul__()
- classmethod PeriodicWload.check_kconfig(plat_info, strict=True)#
Inherited method, see
lisa.wlgen.rta.ConcretePropertyBase.check_kconfig()Check whether
plat_infocontains the kernel KCONFIG keys contained inREQUIRED_KCONFIG_KEYS.
- classmethod PeriodicWload.find_cls(key)#
Inherited method, see
lisa.wlgen.rta.PropertyBase.find_cls()Find which subclass can handle
key.
- classmethod PeriodicWload.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 PeriodicWload.from_product(**kwargs)#
Inherited method, see
lisa.wlgen.rta.ComposableMultiConcretePropertyBase.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.
- classmethod PeriodicWload.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()Provides a
logging.Loggernamed aftercls.
- classmethod PeriodicWload.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 PeriodicWload.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().
- PeriodicWload.to_json(plat_info, **kwargs)#
Inherited method, see
lisa.wlgen.rta.ConcretePropertyBase.to_json()Snippet of JSON content for that property as Python objects.