lisa.wlgen.rta.RTA#
- class lisa.wlgen.rta.RTA(*args, **kwargs)[source]#
Bases:
Workload
An rt-app workload
- Parameters:
Warning
The class constructor only deals with pre-constructed json files. For creating rt-app workloads through other means, see
from_profile()
andby_str()
.For more information about rt-app itself, see scheduler-tools/rt-app
Attributes
The tools required to execute the workload. See
lisa.target.Target.install_tools()
.Properties
logger
inheritedConvenience short-hand for
self.get_logger()
.Methods
Create an rt-app workload using a
RTAConf
.Create an rt-app workload using
RTATask
instances.Create an rt-app workload using a pure string description.
Get the rt-ap calibration value for all CPUs.
Compute the CPU capacities out of the rt-app calibration values.
Get a dictionnary of
lisa.analysis.tasks.TaskID
used in the given trace for this task.Translate an RTA profile task name to a list of
lisa.analysis.tasks.TaskID
as found in alisa.trace.Trace
.Compare
orig_capacities
andnew_capacities
and log warnings if they are not consistent.__enter__()
inherited__exit__()
inheritedCleanup the artifacts of the workload on the target.
__init_subclass__()
inheritedAutomatically decorate
_run()
so that it returns a context manager.cleanup()
inheritedRemove all the artifacts installed on the target with
deploy()
.deploy()
inheritedDeploy the workload on the target.
factory()
inheritedDecorator to use on alternative constructors, i.e. classmethods that return instances of the class.
get_logger()
inheritedProvides a
logging.Logger
named aftercls
.log_locals()
inheritedDebugging aid: log the local variables of the calling function.
run()
inheritedRun the workload and returns the post-processed output.
run_background()
inheritedRun the command asynchronously and give control back to the caller.
wipe_run_dir()
inheritedWipe 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.
- 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 alisa.trace.Trace
.- Returns:
A dictionnary of
rt-app
profile names to list oflisa.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
andnew_capacities
and log warnings if they are not consistent.
- 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 aftercls
.
- 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, uselisa.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, uselisa.wlgen.rta.RTA.from_str()
instead