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-16 17:53:23 +0100
commita5eeb959bf0aef6f49d92aa1440ce0904a7f91d1 (patch)
treec463f0c144880aabeb925c189da5bd104dccdec8 /scripts/runqemu
parentbaae7384098be895a11a382674ddf28908f850b2 (diff)
downloadpoky-a5eeb959bf0aef6f49d92aa1440ce0904a7f91d1.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: 08406e03abddc7290c0c2296aa179725a58155d3) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2d96499823f7de6e16a461426491e015ba63c1ec) Signed-off-by: Steve Sakoman <steve@sakoman.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 24c4a40b50..1525081ad5 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1500,6 +1500,9 @@ class BaseConfig(object):
1500 cmd = "%s %s" % (self.qemu_opt, kernel_opts) 1500 cmd = "%s %s" % (self.qemu_opt, kernel_opts)
1501 cmds = shlex.split(cmd) 1501 cmds = shlex.split(cmd)
1502 logger.info('Running %s\n' % cmd) 1502 logger.info('Running %s\n' % cmd)
1503 with open('/proc/uptime', 'r') as f:
1504 uptime_seconds = f.readline().split()[0]
1505 logger.info('Host uptime: %s\n' % uptime_seconds)
1503 pass_fds = [] 1506 pass_fds = []
1504 if self.taplock_descriptor: 1507 if self.taplock_descriptor:
1505 pass_fds = [self.taplock_descriptor.fileno()] 1508 pass_fds = [self.taplock_descriptor.fileno()]
@@ -1523,6 +1526,9 @@ class BaseConfig(object):
1523 signal.signal(signal.SIGTERM, signal.SIG_IGN) 1526 signal.signal(signal.SIGTERM, signal.SIG_IGN)
1524 1527
1525 logger.info("Cleaning up") 1528 logger.info("Cleaning up")
1529 with open('/proc/uptime', 'r') as f:
1530 uptime_seconds = f.readline().split()[0]
1531 logger.info('Host uptime: %s\n' % uptime_seconds)
1526 if self.cleantap: 1532 if self.cleantap:
1527 cmd = ('sudo', self.qemuifdown, self.tap, self.bindir_native) 1533 cmd = ('sudo', self.qemuifdown, self.tap, self.bindir_native)
1528 logger.debug('Running %s' % str(cmd)) 1534 logger.debug('Running %s' % str(cmd))