From 807003128e9325fddd83c4be1459fd6ba590375e Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Tue, 20 Dec 2016 16:20:59 +0000 Subject: [PATCH] Spec2000 Workload: Updated to use busybox provided from WA. Commands have been updated to use the busybox executable that is installed via WA rather than relying on it already being in PATH on the device as this would fail for devices that it was not installed on. --- wlauto/workloads/spec2000/__init__.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/wlauto/workloads/spec2000/__init__.py b/wlauto/workloads/spec2000/__init__.py index 1ff043d3..c0024c25 100644 --- a/wlauto/workloads/spec2000/__init__.py +++ b/wlauto/workloads/spec2000/__init__.py @@ -151,8 +151,8 @@ class Spec2000(Workload): speed_run_template = 'cd {datadir}; time ({launch_command})' rate_run_template = 'cd {datadir}; time ({loop}; wait)' - loop_template = 'for i in $(busybox seq 1 {threads}); do {launch_command} 1>/dev/null 2>&1 & done' - launch_template = 'busybox taskset {cpumask} {command} 1>/dev/null 2>&1' + loop_template = 'for i in $({busybox} seq 1 {threads}); do {launch_command} 1>/dev/null 2>&1 & done' + launch_template = '{busybox} taskset {cpumask} {command} 1>/dev/null 2>&1' timing_regex = re.compile(r'(?P\d+)m(?P[\d.]+)s\s+(?P\w+)') @@ -287,18 +287,19 @@ class Spec2000(Workload): if len(commandspecs) != 1: raise AssertionError('Must be exactly one command spec specifed in speed mode.') spec = commandspecs[0] - launch_command = self.launch_template.format(command=spec.command, cpumask=spec.cpumask) - self.commands.append((name, - self.speed_run_template.format(datadir=spec.datadir, - launch_command=launch_command))) + launch_command = self.launch_template.format(busybox=self.device.busybox, + command=spec.command, cpumask=spec.cpumask) + self.commands.append((name, self.speed_run_template.format(datadir=spec.datadir, + launch_command=launch_command))) elif self.mode == 'rate': loops = [] for spec in commandspecs: - launch_command = self.launch_template.format(command=spec.command, cpumask=spec.cpumask) - loops.append(self.loop_template.format(launch_command=launch_command, threads=spec.threads)) - self.commands.append((name, - self.rate_run_template.format(datadir=spec.datadir, - loop='; '.join(loops)))) + launch_command = self.launch_template.format(busybox=self.device.busybox, + command=spec.command, cpumask=spec.cpumask) + loops.append(self.loop_template.format(busybox=self.device.busybox, + launch_command=launch_command, threads=spec.threads)) + self.commands.append((name, self.rate_run_template.format(datadir=spec.datadir, + loop='; '.join(loops)))) else: raise ValueError('Unexpected SPEC2000 mode: {}'.format(self.mode)) # Should never get here