1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-10-30 22:54:18 +00:00

Extend device with sleep functionality

This changeset adds the ability to sleep on the device via a
device.sleep() method. This invokes sleep on the target device. This
is useful for situations where the passage of time on the target
device does not match that of the host, e.g., gem5.

This changeset also updates a number of workloads to use this new
sleep method.
This commit is contained in:
Sascha Bischoff
2017-03-02 11:00:49 +00:00
parent 55e40ded1c
commit 4abbe7602a
15 changed files with 31 additions and 38 deletions

View File

@@ -18,7 +18,6 @@
from __future__ import division
import os
import re
import time
import select
import json
import threading
@@ -122,7 +121,7 @@ class GlbCorp(ApkWorkload):
raise WorkloadError(result)
else:
self.logger.debug(result)
time.sleep(DELAY)
self.device.sleep(DELAY)
self.monitor.wait_for_run_end(self.run_timeout)
def update_result(self, context): # NOQA
@@ -209,7 +208,7 @@ class GlbRunMonitor(threading.Thread):
proc = subprocess.Popen(self.command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
while not self.stop_event.is_set():
if self.run_ended.is_set():
time.sleep(DELAY)
self.device.sleep(DELAY)
else:
ready, _, _ = select.select([proc.stdout, proc.stderr], [], [], 2)
if ready: