Skip to content

Commit

Permalink
Dumping journalctl log to a tmp file rather than to memory.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 706891700
  • Loading branch information
p3rf Team authored and copybara-github committed Dec 17, 2024
1 parent 0a87803 commit d28d96f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions perfkitbenchmarker/linux_virtual_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2223,9 +2223,8 @@ def GenerateAndCaptureLogs(self) -> list[str]:
# journalctl
try:
journalctl_path = vm_util.PrependTempDir('journalctl')
journalctl, _ = self.RemoteCommand('sudo journalctl --no-pager')
with open(journalctl_path, 'w') as f:
f.write(journalctl)
self.RemoteCommand('sudo journalctl --no-pager > /tmp/journalctl.tmp')
self.PullFile(journalctl_path, '/tmp/journalctl.tmp')
log_files.append(journalctl_path)
except errors.VirtualMachine.RemoteCommandError:
logging.warning('Failed to capture VM journalctl on %s', self.name)
Expand Down

0 comments on commit d28d96f

Please sign in to comment.