[CRIU] [PATCH] crit: translate pagemap flags into strings

Adrian Reber adrian at lisas.de
Thu Sep 22 00:38:48 PDT 2016


From: Adrian Reber <areber at redhat.com>

This translates pagemap flags into strings for easier readability.

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 images/pagemap.proto     | 2 +-
 lib/py/images/pb2dict.py | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/images/pagemap.proto b/images/pagemap.proto
index d5b3433..42ed5eb 100644
--- a/images/pagemap.proto
+++ b/images/pagemap.proto
@@ -10,5 +10,5 @@ message pagemap_entry {
 	required uint64 vaddr		= 1 [(criu).hex = true];
 	required uint32 nr_pages	= 2;
 	optional bool	in_parent	= 3;
-	optional uint32	flags		= 4 [(criu).hex = true];
+	optional uint32	flags		= 4 [(criu).flags = "pmap.flags" ];
 }
diff --git a/lib/py/images/pb2dict.py b/lib/py/images/pb2dict.py
index 177cda3..36c351b 100644
--- a/lib/py/images/pb2dict.py
+++ b/lib/py/images/pb2dict.py
@@ -99,11 +99,19 @@ rfile_flags_map = [
 	('O_LARGEFILE',	0100000),
 ];
 
+pmap_flags_map = [
+	('PE_PARENT',	1 << 0),
+	('PE_ZERO',	1 << 1),
+	('PE_LAZY',	1 << 2),
+	('PE_PRESENT',	1 << 3),
+];
+
 flags_maps = {
 	'mmap.prot' : mmap_prot_map,
 	'mmap.flags' : mmap_flags_map,
 	'mmap.status' : mmap_status_map,
 	'rfile.flags' : rfile_flags_map,
+	'pmap.flags' : pmap_flags_map,
 }
 
 def map_flags(value, flags_map):
-- 
2.7.4



More information about the CRIU mailing list