[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/15] analyze-migration.py: Remove trick on parsing ramblocks
|
From: |
peterx |
|
Subject: |
[PULL 05/15] analyze-migration.py: Remove trick on parsing ramblocks |
|
Date: |
Fri, 26 Jan 2024 12:17:15 +0800 |
From: Peter Xu <peterx@redhat.com>
RAM_SAVE_FLAG_MEM_SIZE contains the total length of ramblock idstr to know
whether scanning of ramblocks is complete. Drop the trick.
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: 20240117075848.139045-4-peterx@redhat.com">https://lore.kernel.org/r/20240117075848.139045-4-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
scripts/analyze-migration.py | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index a39dfb8766..8a254a5b6a 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -151,17 +151,12 @@ def read(self):
addr &= ~(self.TARGET_PAGE_SIZE - 1)
if flags & self.RAM_SAVE_FLAG_MEM_SIZE:
- while True:
+ total_length = addr
+ while total_length > 0:
namelen = self.file.read8()
- # We assume that no RAM chunk is big enough to ever
- # hit the first byte of the address, so when we see
- # a zero here we know it has to be an address, not the
- # length of the next block.
- if namelen == 0:
- self.file.file.seek(-1, 1)
- break
self.name = self.file.readstr(len = namelen)
len = self.file.read64()
+ total_length -= len
self.sizeinfo[self.name] = '0x%016x' % len
if self.write_memory:
print(self.name)
--
2.43.0
- [PULL 00/15] Migration 20240126 patches, peterx, 2024/01/25
- [PULL 01/15] userfaultfd: use 1ULL to build ioctl masks, peterx, 2024/01/25
- [PULL 02/15] migration: Plug memory leak on HMP migrate error path, peterx, 2024/01/25
- [PULL 03/15] migration: Make threshold_size an uint64_t, peterx, 2024/01/25
- [PULL 04/15] migration: Drop unnecessary check in ram's pending_exact(), peterx, 2024/01/25
- [PULL 05/15] analyze-migration.py: Remove trick on parsing ramblocks,
peterx <=
- [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, peterx, 2024/01/25
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Fabiano Rosas, 2024/01/26
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Peter Maydell, 2024/01/26
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Fabiano Rosas, 2024/01/26
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Peter Xu, 2024/01/28
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Fabiano Rosas, 2024/01/29
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Fabiano Rosas, 2024/01/29
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Peter Maydell, 2024/01/30
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Peter Xu, 2024/01/30
- Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64, Fabiano Rosas, 2024/01/30