From ff3fb16f14aa53f939f8cbec2b65aeabbff6b58d Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Tue, 8 Dec 2015 16:10:00 +0300 Subject: [PATCH] crit: Pretty print vma flags and status To better understand the content of mm-.img and pagemap-.img additional constant names have been added to better resolve the hex value to symbolical names. Signed-off-by: Adrian Reber Signed-off-by: Pavel Emelyanov --- protobuf/vma.proto | 2 +- pycriu/images/pb2dict.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/protobuf/vma.proto b/protobuf/vma.proto index 834836042..e65070711 100644 --- a/protobuf/vma.proto +++ b/protobuf/vma.proto @@ -7,7 +7,7 @@ message vma_entry { required uint64 shmid = 4; required uint32 prot = 5 [(criu).flags = "mmap.prot" ]; required uint32 flags = 6 [(criu).flags = "mmap.flags" ]; - required uint32 status = 7; + required uint32 status = 7 [(criu).flags = "mmap.status" ]; /* * This fd thing is unused in the image, it was lost * while switching from execve restore model. It is diff --git a/pycriu/images/pb2dict.py b/pycriu/images/pb2dict.py index 24923dbfa..2f975e09f 100644 --- a/pycriu/images/pb2dict.py +++ b/pycriu/images/pb2dict.py @@ -69,6 +69,28 @@ mmap_flags_map = [ ('MAP_SHARED', 0x1), ('MAP_PRIVATE', 0x2), ('MAP_ANON', 0x20), + ('MAP_GROWSDOWN', 0x0100), +]; + +mmap_status_map = [ + ('VMA_AREA_NONE', 0 << 0), + ('VMA_AREA_REGULAR', 1 << 0), + ('VMA_AREA_STACK', 1 << 1), + ('VMA_AREA_VSYSCALL', 1 << 2), + ('VMA_AREA_VDSO', 1 << 3), + ('VMA_AREA_HEAP', 1 << 5), + + ('VMA_FILE_PRIVATE', 1 << 6), + ('VMA_FILE_SHARED', 1 << 7), + ('VMA_ANON_SHARED', 1 << 8), + ('VMA_ANON_PRIVATE', 1 << 9), + + ('VMA_AREA_SYSVIPC', 1 << 10), + ('VMA_AREA_SOCKET', 1 << 11), + ('VMA_AREA_VVAR', 1 << 12), + ('VMA_AREA_AIORING', 1 << 13), + + ('VMA_UNSUPP', 1 << 31), ]; rfile_flags_map = [ @@ -82,6 +104,7 @@ rfile_flags_map = [ flags_maps = { 'mmap.prot' : mmap_prot_map, 'mmap.flags' : mmap_flags_map, + 'mmap.status' : mmap_status_map, 'rfile.flags' : rfile_flags_map, }