diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2022-09-09 17:57:34 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2022-09-12 04:45:14 -1000 |
commit | 08406e03abddc7290c0c2296aa179725a58155d3 (patch) | |
tree | 0dde3426afc7426bf037cfd562fc39f4b8c75a62 | |
parent | 2a860de611bebae2e1100380b975b7648b8560d9 (diff) | |
download | openembedded-core-08406e03abddc7290c0c2296aa179725a58155d3.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.
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>
-rwxr-xr-x | scripts/runqemu | 6 |
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): 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()] @@ -1523,6 +1526,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)) |