[CRIU] [PATCH v5 18/42] images: Add NSpids pstree descriptions

Kirill Tkhai ktkhai at virtuozzo.com
Fri May 5 09:15:42 PDT 2017


Add new fields to store NSpid, NSsid, NSpgid for task and NStid for threads.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/pstree.c       |    3 +++
 images/pstree.proto |   17 +++++++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/criu/pstree.c b/criu/pstree.c
index dc99e4240..6051ca5b6 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -337,6 +337,9 @@ int dump_pstree(struct pstree_item *root_item)
 		e.pgid		= vpgid(item);
 		e.sid		= vsid(item);
 		e.n_threads	= item->nr_threads;
+		e.has_pid	= true;
+		e.has_pgid	= true;
+		e.has_sid	= true;
 
 		e.threads = xmalloc(sizeof(e.threads[0]) * e.n_threads);
 		if (!e.threads)
diff --git a/images/pstree.proto b/images/pstree.proto
index 23e88aa74..6bb560849 100644
--- a/images/pstree.proto
+++ b/images/pstree.proto
@@ -1,9 +1,18 @@
 syntax = "proto2";
 
+message ns_tid {
+	repeated uint32 tid				= 1;
+}
+
 message pstree_entry {
-	required uint32			pid		= 1;
-	required uint32			ppid		= 2;
-	required uint32			pgid		= 3;
-	required uint32			sid		= 4;
+	optional uint32			pid		= 1;
+	required uint32			ppid		= 2;	/* Pid of parent in pid_ns NS_ROOT */
+	optional uint32			pgid		= 3;
+	optional uint32			sid		= 4;
 	repeated uint32			threads		= 5;
+
+	repeated uint32			ns_pid		= 6;
+	repeated uint32			ns_pgid		= 7;
+	repeated uint32			ns_sid		= 8;
+	repeated ns_tid			tids		= 9;
 }



More information about the CRIU mailing list