diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2021-06-03 17:23:08 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-06-06 23:16:50 +0100 |
commit | 998d23a2c6c592568fdd9c3f933f55920c7979bb (patch) | |
tree | 988e47311deec2985faf0b3ca40540437dcdcdbd /scripts | |
parent | ae7595a603f3fea1750f3f170e0e7c8098a352c7 (diff) | |
download | poky-998d23a2c6c592568fdd9c3f933f55920c7979bb.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.
(From OE-Core rev: be213114c1349e02ca48fd617a6c3badae8aa101)
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 5 |
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 | |||
18 | import glob | 18 | import glob |
19 | import configparser | 19 | import configparser |
20 | import signal | 20 | import signal |
21 | import time | ||
21 | 22 | ||
22 | class RunQemuError(Exception): | 23 | class RunQemuError(Exception): |
23 | """Custom exception to raise on known errors.""" | 24 | """Custom exception to raise on known errors.""" |
@@ -1201,8 +1202,10 @@ class BaseConfig(object): | |||
1201 | tmpfsdir = os.environ.get("RUNQEMU_TMPFS_DIR", None) | 1202 | tmpfsdir = os.environ.get("RUNQEMU_TMPFS_DIR", None) |
1202 | if self.snapshot and tmpfsdir: | 1203 | if self.snapshot and tmpfsdir: |
1203 | newrootfs = os.path.join(tmpfsdir, os.path.basename(self.rootfs)) + "." + str(os.getpid()) | 1204 | newrootfs = os.path.join(tmpfsdir, os.path.basename(self.rootfs)) + "." + str(os.getpid()) |
1205 | logger.info("Copying rootfs to %s" % newrootfs) | ||
1206 | copy_start = time.time() | ||
1204 | shutil.copyfile(self.rootfs, newrootfs) | 1207 | shutil.copyfile(self.rootfs, newrootfs) |
1205 | #print("Copying rootfs to tmpfs: %s" % newrootfs) | 1208 | logger.info("Copy done in %s seconds" % (time.time() - copy_start)) |
1206 | self.rootfs = newrootfs | 1209 | self.rootfs = newrootfs |
1207 | # Don't need a second copy now! | 1210 | # Don't need a second copy now! |
1208 | self.snapshot = False | 1211 | self.snapshot = False |