diff --git a/lisa/assets/binaries/arm64/rt-app b/lisa/assets/binaries/arm64/rt-app index cb853be8fbeafefeecf8163ab90626c7d8e2b36e..da641873df91751e59cf838cb0b18bd00a905283 100755 Binary files a/lisa/assets/binaries/arm64/rt-app and b/lisa/assets/binaries/arm64/rt-app differ diff --git a/lisa/assets/binaries/armeabi/rt-app b/lisa/assets/binaries/armeabi/rt-app index 5e399327c6bfee22beeac2f71e523bc369068411..60223ded169dc55070a7759ddd47ee4a85fb0fd6 100755 Binary files a/lisa/assets/binaries/armeabi/rt-app and b/lisa/assets/binaries/armeabi/rt-app differ diff --git a/lisa/assets/binaries/x86_64/rt-app b/lisa/assets/binaries/x86_64/rt-app index 6721ea965d8921d1656ad1faa0d0aedeaf4fc919..c5699cee820cf72a5906c2227bb45bc9e301c750 100755 Binary files a/lisa/assets/binaries/x86_64/rt-app and b/lisa/assets/binaries/x86_64/rt-app differ diff --git a/lisa/tests/base.py b/lisa/tests/base.py index 49faaeeee5b04d45b12df3985845ac438330b2e7..6577075ebe454426f4bf0f6fb32aef93f14c7abb 100644 --- a/lisa/tests/base.py +++ b/lisa/tests/base.py @@ -37,7 +37,8 @@ from devlib.trace.dmesg import KernelLogEntry from devlib import TargetStableError from lisa.analysis.tasks import TasksAnalysis -from lisa.trace import Trace, requires_events, TaskID +from lisa.trace import requires_events, may_use_events +from lisa.trace import Trace, TaskID from lisa.wlgen.rta import RTA from lisa.target import Target @@ -1268,8 +1269,13 @@ class RTATestBundle(FtraceTestBundle, DmesgTestBundle): profile = profile or cls.get_rtapp_profile(target.plat_info) cg_cfg = cg_cfg or cls.get_cgroup_configuration(target.plat_info) + trace_events = [event.replace('rtapp_', '') + for event in ftrace_coll.events + if event.startswith("rtapp_")] + wload = RTA.by_profile(target, "rta_{}".format(cls.__name__.lower()), - profile, res_dir=res_dir) + profile, res_dir=res_dir, + trace_events=trace_events) cgroup = cls._target_configure_cgroup(target, cg_cfg) as_root = cgroup is not None diff --git a/lisa/wlgen/rta.py b/lisa/wlgen/rta.py index 59c1694025f4ae37d54bb97137ff6148d2b49b26..e5b83f5e9b881894513b8f083dc4fd5c3b6af263 100644 --- a/lisa/wlgen/rta.py +++ b/lisa/wlgen/rta.py @@ -72,7 +72,8 @@ class RTA(Workload): self.command = '{0:s} {1:s} 2>&1'.format(quote(rta_cmd), quote(self.remote_json)) - def _late_init(self, calibration=None, tasks_names=None): + def _late_init(self, calibration=None, tasks_names=None, + log_stats=False, trace_events=[]): """ Complete initialization with a ready json file @@ -93,6 +94,8 @@ class RTA(Workload): self.calibration = calibration self.tasks = sorted(tasks_names) + self.log_stats = log_stats + self.trace_events = trace_events # Move configuration file to target self.target.push(self.local_json, self.remote_json) @@ -105,6 +108,8 @@ class RTA(Workload): # TODO: handle background case return + if not self.log_stats: + return logger.debug('Pulling logfiles to [%s]...', self.res_dir) for task in self.tasks: # RT-app appends some number to the logs, so we can't predict the @@ -132,7 +137,8 @@ class RTA(Workload): @classmethod def by_profile(cls, target, name, profile, res_dir=None, default_policy=None, - max_duration_s=None, calibration=None): + max_duration_s=None, calibration=None, + log_stats=False, trace_events=[]): """ Create an rt-app workload using :class:`RTATask` instances @@ -151,6 +157,16 @@ class RTA(Workload): be an integer value or a CPU string (e.g. "CPU0"). :type calibration: int or str + :param log_stats: Generate a log file with stats for each task + :type log_stats: bool + + :param trace_events: 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: + https://github.com/scheduler-tools/rt-app/blob/master/doc/tutorial.txt + By default, no events are generated. + :type trace_events: list(str) + A simple profile workload would be:: task = Periodic(duty_cycle_pct=5) @@ -184,7 +200,8 @@ class RTA(Workload): 'default_policy': 'SCHED_OTHER', 'duration': -1 if not max_duration_s else max_duration_s, 'calibration': calibration, - 'logdir': self.run_dir, + 'logstats' : log_stats, + 'ftrace': ','.join(trace_events), } if max_duration_s: @@ -240,7 +257,9 @@ class RTA(Workload): with open(self.local_json, 'w') as outfile: json.dump(rta_profile, outfile, indent=4, separators=(',', ': ')) - self._late_init(calibration=calibration, tasks_names=list(profile.keys())) + self._late_init(calibration=calibration, + tasks_names=list(profile.keys()), + log_stats=log_stats, trace_events=trace_events) return self @classmethod