lisa.wlgen.rta.RTAConf#

class lisa.wlgen.rta.RTAConf(conf)[source]#

Bases: Loggable, Mapping

JSON configuration for rt-app.

Parameters:

conf (object) – Python object graph with the JSON content.

Attributes

ALLOWED_TASK_NAME_REGEX

Regex to check whether the rt-app task name is valid.

__reversed__ inherited

See collections.abc.Mapping.__reversed__

Properties

json

rt-app configuration file content as a JSON string.

logger inherited

Convenience short-hand for self.get_logger().

Methods

__getitem__()

__iter__()

__len__()

_process_template()

from_path()

Same as from_str() but with a file path instead.

from_profile()

Create an rt-app workload using RTAPhase instances.

from_str()

Create an rt-app workload using a pure string description.

__class_getitem__() inherited

See collections.abc.Iterable.__class_getitem__()

__contains__() inherited

See collections.abc.Mapping.__contains__()

get() inherited

See collections.abc.Mapping.get()

get_logger() inherited

Provides a logging.Logger named after cls.

items() inherited

See collections.abc.Mapping.items()

keys() inherited

See collections.abc.Mapping.keys()

log_locals() inherited

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

values() inherited

See collections.abc.Mapping.values()

Attributes#

RTAConf.ALLOWED_TASK_NAME_REGEX = '^[a-zA-Z0-9_]+$'#

Regex to check whether the rt-app task name is valid.

RTAConf.__reversed__ = None#

Properties#

property RTAConf.json[source]#

rt-app configuration file content as a JSON string.

property RTAConf.logger#

Inherited property, see lisa.utils.Loggable.logger

Convenience short-hand for self.get_logger().

Methods#

RTAConf.__getitem__(key)[source]#
RTAConf.__iter__()[source]#
RTAConf.__len__()[source]#
classmethod RTAConf._process_template(template, duration=None, pload=None, log_dir=None)[source]#

Turn a raw string rt-app description into a JSON dict. Also, process some tokens and replace them.

Parameters:
  • template (str) – The raw string to process

  • duration (int) – The value to replace __DURATION__ with

  • pload (int or str) – The value to replace __PVALUE__ with

  • log_dir (str) – The value to replace __LOGDIR__ and __WORKDIR__ with.

Returns:

a JSON dict

classmethod RTAConf.from_path(path, **kwargs)[source]#

Same as from_str() but with a file path instead.

classmethod RTAConf.from_profile(profile, *, plat_info, force_defaults=False, max_duration_s=None, calibration=None, log_stats=False, trace_events=None, run_dir=None, lock_pages=False, no_force_default_keys=None)[source]#

Create an rt-app workload using RTAPhase instances

Parameters:
  • profile (dict) – The workload description in a {task_name : RTATask} shape

  • plat_info (lisa.platforms.platinfo.PlatformInfo) – Platform information used to tweak the configuration file according to the target.

  • force_defaults (bool) – If True, default values for all settings will be set in the first phase (unless they are set by the profile). If False, defaults will be removed from the file (even if they were explicitly set by the user).

  • no_force_default_keys (list(str) or None) – JSON keys for which no default will be forced by force_defaults=True.

  • max_duration_s (int) – Maximum duration of the workload. Will be determined by the longest running task if not specified.

  • calibration (int or str) – The calibration value to be used by rt-app. This can be an integer value or a CPU string (e.g. “CPU0”).

  • log_stats (bool) – Generate a log file with stats for each task

  • lock_pages (bool) – Lock the pages to memory to avoid jitter. Requires running as root.

  • trace_events (list(str)) – A list of trace events to generate. For a full list of trace events which can be generated by rt-app, refer to the tool documentation: scheduler-tools/rt-app By default, no events are generated.

classmethod RTAConf.from_str(str_conf, plat_info, run_dir, max_duration_s=None, calibration=None)[source]#

Create an rt-app workload using a pure string description

Parameters:
  • str_conf (str) – The raw string description. This must be a valid json description, with the exception of some tokens (see _process_template()) that will be replaced automagically.

  • plat_info (lisa.platforms.platinfo.PlatformInfo) – Platform information used to tweak the configuration file according to the target.

  • run_dir (str) – Directory used by rt-app to produce artifacts

  • max_duration_s (int) – Maximum duration of the workload.

  • calibration (int or str) – The calibration value to be used by rt-app. This can be an integer value or a CPU string (e.g. “CPU0”).

classmethod RTAConf.__class_getitem__()#

Inherited method, see collections.abc.Iterable.__class_getitem__()

RTAConf.__contains__()#

Inherited method, see collections.abc.Mapping.__contains__()

RTAConf.get()#

Inherited method, see collections.abc.Mapping.get()

classmethod RTAConf.get_logger(suffix=None)#

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

Provides a logging.Logger named after cls.

RTAConf.items()#

Inherited method, see collections.abc.Mapping.items()

RTAConf.keys()#

Inherited method, see collections.abc.Mapping.keys()

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

RTAConf.values()#

Inherited method, see collections.abc.Mapping.values()