[CRIU] [PATCH v4 17/41] images: Add NSpids pstree descriptions
Kirill Tkhai
ktkhai at virtuozzo.com
Thu May 4 09:07:38 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 8e8064009..1c29c2f3f 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -333,6 +333,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