[CRIU] [PATCH v2 2/4] IPC: show dump content

Kinsbursky Stanislav skinsbursky at openvz.org
Tue Jan 31 06:53:29 EST 2012


From: Stanislav Kinsbursky <skinsbursky at parallels.com>



Signed-off-by: Stanislav Kinsbursky <skinsbursky at parallels.com>

---
 cr-show.c |    4 ++++
 ipc_ns.c  |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/cr-show.c b/cr-show.c
index 68174d1..e560245 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -20,6 +20,7 @@
 #include "sockets.h"
 #include "image.h"
 #include "uts_ns.h"
+#include "ipc_ns.h"
 
 #define DEF_PAGES_PER_LINE	6
 
@@ -514,6 +515,9 @@ static int cr_parse_file(struct cr_options *opts)
 	case CREDS_MAGIC:
 		show_creds(fd);
 		break;
+	case IPCNS_MAGIC:
+		show_ipc_ns(fd);
+		break;
 	default:
 		pr_err("Unknown magic %x on %s\n", magic, opts->show_dump_file);
 		goto err;
diff --git a/ipc_ns.c b/ipc_ns.c
index 6558d71..e20a01a 100644
--- a/ipc_ns.c
+++ b/ipc_ns.c
@@ -274,3 +274,39 @@ int dump_ipc_ns(int ns_pid, struct cr_fdset *fdset)
 	}
 	return 0;
 }
+
+static void show_ipc_entry(struct ipc_ns_entry *entry)
+{
+	pr_info("/proc/sys/kernel/sem             : %d\t%d\t%d\t%d\n",
+				entry->sem_ctls[0], entry->sem_ctls[1],
+				entry->sem_ctls[2], entry->sem_ctls[3]);
+	pr_info("/proc/sys/kernel/msgmax          : %d\n", entry->msg_ctlmax);
+	pr_info("/proc/sys/kernel/msgmnb          : %d\n", entry->msg_ctlmnb);
+	pr_info("/proc/sys/kernel/msgmni          : %d\n", entry->msg_ctlmni);
+	pr_info("/proc/sys/kernel/auto_msgmni     : %d\n", entry->auto_msgmni);
+	pr_info("/proc/sys/kernel/shmmax          : %ld\n", *(u64 *)entry->shm_ctlmax);
+	pr_info("/proc/sys/kernel/shmall          : %ld\n", *(u64 *)entry->shm_ctlall);
+	pr_info("/proc/sys/kernel/shmmni          : %d\n", entry->shm_ctlmni);
+	pr_info("/proc/sys/kernel/shm_rmid_forced : %d\n", entry->shm_rmid_forced);
+	pr_info("/proc/sys/fs/mqueue/queues_max   : %d\n", entry->mq_queues_max);
+	pr_info("/proc/sys/fs/mqueue/msg_max      : %d\n", entry->mq_msg_max);
+	pr_info("/proc/sys/fs/mqueue/msgsize_max  : %d\n", entry->mq_msgsize_max);
+}
+
+static void show_ipc_data(int fd)
+{
+	int ret;
+	struct ipc_ns_data ipc;
+
+	ret = read_img(fd, &ipc);
+	if (ret <= 0)
+		return;
+	show_ipc_entry(&ipc.entry);
+}
+
+void show_ipc_ns(int fd)
+{
+	pr_img_head(CR_FD_IPCNS);
+	show_ipc_data(fd);
+	pr_img_tail(CR_FD_IPCNS);
+}



More information about the CRIU mailing list