[CRIU] [PATCH] pstree: Add more debug output for prepare_pstree_kobj_ids

Cyrill Gorcunov gorcunov at openvz.org
Fri Mar 15 04:51:29 EDT 2013


Quite useful for debuggin.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pstree.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/pstree.c b/pstree.c
index fb0b25b..0cd8fbd 100644
--- a/pstree.c
+++ b/pstree.c
@@ -473,6 +473,17 @@ static unsigned long get_clone_mask(TaskKobjIdsEntry *i,
 	return mask;
 }
 
+static void __show_kobj_ids(char *prefix, TaskKobjIdsEntry *ids)
+{
+	if (!ids)
+		return;
+
+	pr_debug("%s: %x %x %x %x %x %x %x %x %x\n", prefix,
+		ids->vm_id, ids->files_id, ids->fs_id, ids->sighand_id,
+		ids->pid_ns_id, ids->net_ns_id, ids->ipc_ns_id,
+		ids->uts_ns_id, ids->mnt_ns_id);
+}
+
 static int prepare_pstree_kobj_ids(void)
 {
 	struct pstree_item *item;
@@ -507,6 +518,9 @@ static int prepare_pstree_kobj_ids(void)
 			}
 		}
 
+		__show_kobj_ids("parent ids", ids);
+		__show_kobj_ids("child  ids", item->ids);
+
 		cflags = get_clone_mask(item->ids, ids);
 
 		if (cflags & CLONE_FILES) {
@@ -546,6 +560,7 @@ set_mask:
 		}
 	}
 
+	pr_debug("NS mask to use %lx\n", current_ns_mask);
 	return 0;
 }
 
-- 
1.8.1.4



More information about the CRIU mailing list