[CRIU] [PATCH] crit: Pretty print vma flags and status

Adrian Reber adrian at lisas.de
Tue Dec 8 05:10:58 PST 2015


From: Adrian Reber <areber at redhat.com>

To better understand the content of mm-<ID>.img and pagemap-<ID>.img
additional constant names have been added to better resolve the hex
value to symbolical names.

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 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 8348360..e650707 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 24923db..2f975e0 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,
 }
 
-- 
1.8.3.1



More information about the CRIU mailing list