lisa.wlgen.rta.PeriodicWload#

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

Bases: WloadPropertyBase, ComposableMultiConcretePropertyBase

Periodic 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_pct value on asymmetric systems. If None, it will be assumed to be the fastest CPU on the system.

  • scale_for_freq (int or None) – Frequency used to scale duty_cycle_pct in a similar way to scale_for_cpu. This is only valid in conjunction with scale_for_cpu.

  • run_wload (collections.abc.Callable or None) – Workload factory callback used for the running part. It will be called with a single duration parameter (in seconds) and must return a WloadPropertyBase. Note that the passed duration is scaled according to scale_for_cpu and scale_for_freq

  • sleep_wload (collections.abc.Callable or None) – Workload factory callback used for the sleeping part. It will be called with a duration parameter and period parameter (in seconds) and must return a WloadPropertyBase. Note that the passed duration is scaled according to scale_for_cpu and scale_for_freq

  • guaranteed_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__ 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

JSON_KEY 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

key inherited

Key of the instance.

logger inherited

Convenience short-hand for self.get_logger().

val inherited

Value “payload” of the property.

Methods

__init_subclass__()

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

to_events()

unscaled_duty_cycle_pct()

HASH_COERCE() inherited

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

__add__() inherited

Adding two workloads together concatenates them.

__and__() inherited

Combine two instances of the same property together.

__await__() inherited

__getattr__() inherited

Lookup the attributes values defined in _ATTRIBUTES.

__mul__() inherited

Replicate the given workload n times.

__rmul__() inherited

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.

from_product() inherited

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.

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#

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_KEYS

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

PeriodicWload.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 PeriodicWload.key#

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

Key of the instance.

property PeriodicWload.logger#

Inherited property, see lisa.utils.Loggable.logger

Convenience short-hand for self.get_logger().

property PeriodicWload.val#

Inherited property, see lisa.wlgen.rta.WloadPropertyBase.val

Value “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.to_events(plat_info)[source]#
PeriodicWload.unscaled_duty_cycle_pct(plat_info)[source]#
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 n times.

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_info contains the kernel KCONFIG keys contained in REQUIRED_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.Logger named after cls.

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