lisa.wlgen.rta.RTA#

class lisa.wlgen.rta.RTA(*args, **kwargs)[source]#

Bases: Workload

An rt-app workload

Parameters:
  • json_file (str) – Path to the rt-app json description

  • log_level (str or None) – Set rt-app log level. One of: * critical * error * notice * info * debug

Warning

The class constructor only deals with pre-constructed json files. For creating rt-app workloads through other means, see from_profile() and by_str().

For more information about rt-app itself, see scheduler-tools/rt-app

Attributes

REQUIRED_TOOLS

The tools required to execute the workload. See lisa.target.Target.install_tools().

Properties

logger inherited

Convenience short-hand for self.get_logger().

Methods

__del__()

from_conf()

Create an rt-app workload using a RTAConf.

from_profile()

Create an rt-app workload using RTATask instances.

from_str()

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

get_cpu_calibrations()

Get the rt-ap calibration value for all CPUs.

get_cpu_capacities_from_calibrations()

Compute the CPU capacities out of the rt-app calibration values.

get_trace_task_names()

Get a dictionnary of lisa.analysis.tasks.TaskID used in the given trace for this task.

resolve_trace_task_names()

Translate an RTA profile task name to a list of lisa.analysis.tasks.TaskID as found in a lisa.trace.Trace.

warn_capacities_mismatch()

Compare orig_capacities and new_capacities and log warnings if they are not consistent.

__enter__() inherited

__exit__() inherited

Cleanup the artifacts of the workload on the target.

__init_subclass__() inherited

Automatically decorate _run() so that it returns a context manager.

cleanup() inherited

Remove all the artifacts installed on the target with deploy().

deploy() inherited

Deploy the workload on the target.

factory() inherited

Decorator to use on alternative constructors, i.e. classmethods that return instances of the class.

get_logger() inherited

Provides a logging.Logger named after cls.

log_locals() inherited

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

run() inherited

Run the workload and returns the post-processed output.

run_background() inherited

Run the command asynchronously and give control back to the caller.

wipe_run_dir() inherited

Wipe all content from the run_dir target directory and all its empty parents.

Attributes#

RTA.REQUIRED_TOOLS = ['rt-app']#

The tools required to execute the workload. See lisa.target.Target.install_tools().

Properties#

property RTA.logger#

Inherited property, see lisa.utils.Loggable.logger

Convenience short-hand for self.get_logger().

Methods#

RTA.__del__()#
classmethod RTA.from_conf(target, conf, name=None, res_dir=None, *, log_stats=False, update_cpu_capacities=None, log_level=None, run_dir=None, cpus=None, cgroup=None, as_root=False, timeout=None, log_std_streams=True, wipe_run_dir=True, wipe_res_dir=False)[source]#

Create an rt-app workload using a RTAConf.

Parameters:
  • target (lisa.target.Target) – Target that the workload will run on.

  • conf (RTAConf) – Configuration object.

  • name (str or None) – Name of the workload.

  • res_dir (str or None) – Host folder to store artifacts in.

classmethod RTA.from_profile(target, profile, name=None, res_dir=None, log_stats=False, *, as_root=False, calibration=None, cgroup=None, cpus=None, force_defaults=False, log_level=None, log_std_streams=True, max_duration_s=None, no_force_default_keys=None, run_dir=None, timeout=None, trace_events=None, update_cpu_capacities=None, wipe_res_dir=False, wipe_run_dir=True)[source]#

Create an rt-app workload using RTATask instances

Parameters:
  • target (lisa.target.Target) – Target that the workload will run on.

  • name (str or None) – Name of the workload.

  • res_dir (str or None) – Host folder to store artifacts in.

Other arguments:

Forwarded to RTAConf.from_profile()

classmethod RTA.from_str(target, str_conf, name=None, res_dir=None, *, as_root=False, calibration=None, cgroup=None, cpus=None, log_level=None, log_stats=False, log_std_streams=True, max_duration_s=None, run_dir=None, timeout=None, update_cpu_capacities=None, wipe_res_dir=False, wipe_run_dir=True)[source]#

Create an rt-app workload using a pure string description

Parameters:
  • target (lisa.target.Target) – Target that the workload will run on.

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

  • name (str or None) – Name of the workload.

  • res_dir (str or None) – Host folder to store artifacts in.

Other arguments:

Forwarded to RTAConf.from_profile()

classmethod RTA.get_cpu_calibrations(target, res_dir=None)[source]#

Get the rt-ap calibration value for all CPUs.

Parameters:

target (lisa.target.Target) – Target to run calibration on.

Returns:

Dict mapping CPU numbers to rt-app calibration values.

classmethod RTA.get_cpu_capacities_from_calibrations(orig_capacities, calibrations)[source]#

Compute the CPU capacities out of the rt-app calibration values.

Returns:

A mapping of CPU to capacity.

Parameters:
  • orig_capacities (dict(int, int)) – Original capacities as a mapping of CPU ID to capacity.

  • calibrations (dict) – Mapping of CPU to pload value.

RTA.get_trace_task_names(trace)[source]#

Get a dictionnary of lisa.analysis.tasks.TaskID used in the given trace for this task.

classmethod RTA.resolve_trace_task_names(trace, names)[source]#

Translate an RTA profile task name to a list of lisa.analysis.tasks.TaskID as found in a lisa.trace.Trace.

Returns:

A dictionnary of rt-app profile names to list of lisa.analysis.tasks.TaskID The list will contain more than one item if the task forked.

Parameters:
  • trace (lisa.trace.Trace) – Trace to look at.

  • names (list(str)) – rt-app task names as specified in profile keys

classmethod RTA.warn_capacities_mismatch(orig_capacities, new_capacities)[source]#

Compare orig_capacities and new_capacities and log warnings if they are not consistent.

Parameters:
  • orig_capacities (dict(int, int)) – Original CPU capacities, as a map of CPU to capacity.

  • new_capacities (dict(int, int)) – New CPU capacities, as a map of CPU to capacity.

RTA.__enter__()#

Inherited method, see lisa.wlgen.workload.Workload.__enter__()

RTA.__exit__(exc_type, exc_val, exc_tb)#

Inherited method, see lisa.wlgen.workload.Workload.__exit__()

Cleanup the artifacts of the workload on the target.

classmethod RTA.__init_subclass__(*args, **kwargs)#

Inherited method, see lisa.wlgen.workload.Workload.__init_subclass__()

Automatically decorate _run() so that it returns a context manager.

RTA.cleanup()#

Inherited method, see lisa.wlgen.workload.Workload.cleanup()

Remove all the artifacts installed on the target with deploy().

RTA.deploy()#

Inherited method, see lisa.wlgen.workload.Workload.deploy()

Deploy the workload on the target.

classmethod RTA.factory(f)#

Inherited method, see lisa.utils.PartialInit.factory()

Decorator to use on alternative constructors, i.e. classmethods that return instances of the class.

classmethod RTA.get_logger(suffix=None)#

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

Provides a logging.Logger named after cls.

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

RTA.run(cpus=None, cgroup=None, as_root=False, timeout=None)#

Inherited method, see lisa.wlgen.workload.Workload.run()

Run the workload and returns the post-processed output.

RTA.run_background()#

Inherited method, see lisa.wlgen.workload.Workload.run_background()

Run the command asynchronously and give control back to the caller.

RTA.wipe_run_dir()#

Inherited method, see lisa.wlgen.workload.Workload.wipe_run_dir()

Wipe all content from the run_dir target directory and all its empty parents.

classmethod RTA.by_profile(*args, **kwargs)[source]#

Deprecated since version 2.0.

by_profile() is deprecated and will be removed in version 4.0, use lisa.wlgen.rta.RTA.from_profile() instead

classmethod RTA.by_str(*args, **kwargs)[source]#

Deprecated since version 2.0.

by_str() is deprecated and will be removed in version 4.0, use lisa.wlgen.rta.RTA.from_str() instead