All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] runqemu: time the copy to tmpfs
@ 2021-06-03 15:23 Alexandre Belloni
  0 siblings, 0 replies; only message in thread
From: Alexandre Belloni @ 2021-06-03 15:23 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexandre Belloni

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>
---
 scripts/runqemu | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index e2dc529baaf1..1f332ef52529 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
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-03 15:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 15:23 [PATCH] runqemu: time the copy to tmpfs Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.