2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00
criu/test/maps.py
Andrey Vagin 4c52aaf441 zdtm: check that a process has the same set of VMS-s after restore
Some VMA-s can be merged on restore. For example, If a process maps
VMA1, VMA2 and then VMA3 between the previous ones.
|VMA1|VMA3|VMA2|
The VMA3 will be merged only with VMA1, but all three VMA-s will be
merged on restore, because they are mmaped in a correct order VMA1,
VMA3, VMA2.

Due to this issue, we have a small script for merging continuous VMA-s.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-23 15:23:12 +04:00

17 lines
249 B
Python

import sys
start = 0;
end = 0;
for l in sys.stdin:
l = l.split()[0]
s, e = l.split('-')
s = int("0x" + s, 0)
e = int("0x" + e, 0)
if end == s:
end = e;
else:
print "%x-%x" % (start, end)
start = s
end = e
print "%x-%x" % (start, end)