summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-06-03 17:23:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-06 23:14:12 +0100
commitbe213114c1349e02ca48fd617a6c3badae8aa101 (patch)
tree7aaebc78d4e397e3cae9feea3010c2cb1ddd78c6 /scripts
parentd6b62b5a9d6c64971b9f981a4732791658150e43 (diff)
downloadopenembedded-core-contrib-be213114c1349e02ca48fd617a6c3badae8aa101.tar.gz
runqemu: time the copy to tmpfs
Measure and display the time it takes to copy the rootfs to its new location (usually in tmpfs) to try to understand whether it sometimes takes a lot of time on the autobuilders. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index e2dc529baa..1f332ef525 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -18,6 +18,7 @@ import shutil
import glob
import configparser
import signal
+import time
class RunQemuError(Exception):
"""Custom exception to raise on known errors."""
@@ -1201,8 +1202,10 @@ class BaseConfig(object):
tmpfsdir = os.environ.get("RUNQEMU_TMPFS_DIR", None)
if self.snapshot and tmpfsdir:
newrootfs = os.path.join(tmpfsdir, os.path.basename(self.rootfs)) + "." + str(os.getpid())
+ logger.info("Copying rootfs to %s" % newrootfs)
+ copy_start = time.time()
shutil.copyfile(self.rootfs, newrootfs)
- #print("Copying rootfs to tmpfs: %s" % newrootfs)
+ logger.info("Copy done in %s seconds" % (time.time() - copy_start))
self.rootfs = newrootfs
# Don't need a second copy now!
self.snapshot = False