summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2022-09-09 17:57:34 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-12 08:33:56 +0100
commit9140c79bf9d23b62363fea2eaf9cf6ad8ed01fbf (patch)
treeae9e3b69a627867cbc8093ebba1a30bb643b7956 /scripts/runqemu
parentbcf13b121a4f5ca2f1ca6c8ca3d0fee69564df46 (diff)
downloadpoky-9140c79bf9d23b62363fea2eaf9cf6ad8ed01fbf.tar.gz
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 <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu6
1 files changed, 6 insertions, 0 deletions
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):
1505 cmd = "%s %s" % (self.qemu_opt, kernel_opts) 1505 cmd = "%s %s" % (self.qemu_opt, kernel_opts)
1506 cmds = shlex.split(cmd) 1506 cmds = shlex.split(cmd)
1507 logger.info('Running %s\n' % cmd) 1507 logger.info('Running %s\n' % cmd)
1508 with open('/proc/uptime', 'r') as f:
1509 uptime_seconds = f.readline().split()[0]
1510 logger.info('Host uptime: %s\n' % uptime_seconds)
1508 pass_fds = [] 1511 pass_fds = []
1509 if self.taplock_descriptor: 1512 if self.taplock_descriptor:
1510 pass_fds = [self.taplock_descriptor.fileno()] 1513 pass_fds = [self.taplock_descriptor.fileno()]
@@ -1528,6 +1531,9 @@ class BaseConfig(object):
1528 signal.signal(signal.SIGTERM, signal.SIG_IGN) 1531 signal.signal(signal.SIGTERM, signal.SIG_IGN)
1529 1532
1530 logger.info("Cleaning up") 1533 logger.info("Cleaning up")
1534 with open('/proc/uptime', 'r') as f:
1535 uptime_seconds = f.readline().split()[0]
1536 logger.info('Host uptime: %s\n' % uptime_seconds)
1531 if self.cleantap: 1537 if self.cleantap:
1532 cmd = ('sudo', self.qemuifdown, self.tap, self.bindir_native) 1538 cmd = ('sudo', self.qemuifdown, self.tap, self.bindir_native)
1533 logger.debug('Running %s' % str(cmd)) 1539 logger.debug('Running %s' % str(cmd))