From 9140c79bf9d23b62363fea2eaf9cf6ad8ed01fbf Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Fri, 9 Sep 2022 17:57:34 +0200 Subject: [PATCH] runqemu: display host uptime when starting In order to be able to debug issues on the host that have an impact on the guest, it is useful to get the uptime of the host while starting so we can match with the events in dmesg. Also include the uptime when cleaning up. (From OE-Core rev: 2d96499823f7de6e16a461426491e015ba63c1ec) Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- scripts/runqemu | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/runqemu b/scripts/runqemu index b6fc212ebe..983f7514c7 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1505,6 +1505,9 @@ class BaseConfig(object): cmd = "%s %s" % (self.qemu_opt, kernel_opts) cmds = shlex.split(cmd) logger.info('Running %s\n' % cmd) + with open('/proc/uptime', 'r') as f: + uptime_seconds = f.readline().split()[0] + logger.info('Host uptime: %s\n' % uptime_seconds) pass_fds = [] if self.taplock_descriptor: pass_fds = [self.taplock_descriptor.fileno()] @@ -1528,6 +1531,9 @@ class BaseConfig(object): signal.signal(signal.SIGTERM, signal.SIG_IGN) logger.info("Cleaning up") + with open('/proc/uptime', 'r') as f: + uptime_seconds = f.readline().split()[0] + logger.info('Host uptime: %s\n' % uptime_seconds) if self.cleantap: cmd = ('sudo', self.qemuifdown, self.tap, self.bindir_native) logger.debug('Running %s' % str(cmd))