[CRIU] [PATCH 03/13] crtools: add a callback to show signal=*.img

Andrey Vagin avagin at openvz.org
Fri Mar 15 09:49:14 EDT 2013


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-show.c         | 23 +++++++++++++++++++++++
 include/crtools.h |  1 +
 2 files changed, 24 insertions(+)

diff --git a/cr-show.c b/cr-show.c
index 15d48d2..36c5512 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -43,6 +43,7 @@
 #include "protobuf/core.pb-c.h"
 #include "protobuf/tty.pb-c.h"
 #include "protobuf/pagemap.pb-c.h"
+#include "protobuf/siginfo.pb-c.h"
 
 #define DEF_PAGES_PER_LINE	6
 
@@ -223,6 +224,28 @@ void show_pagemap(int fd, struct cr_options *o)
 	return pb_show_plain(fd, PB_PAGEMAP);
 }
 
+void show_siginfo(int fd, struct cr_options *o)
+{
+	int ret;
+
+	pr_img_head(CR_FD_SIGNAL);
+	while (1) {
+		SiginfoEntry *sie;
+		siginfo_t *info;
+
+		ret = pb_read_one_eof(fd, &sie, PB_SIGINFO);
+		if (ret <= 0)
+			break;
+
+		info = (siginfo_t *) sie->siginfo.data;
+		pr_msg("signal: si_signo=%d si_code=%x\n",
+				info->si_signo, info->si_code);
+		siginfo_entry__free_unpacked(sie, NULL);
+
+	}
+	pr_img_tail(CR_FD_SIGNAL);
+}
+
 void show_sigacts(int fd_sigacts, struct cr_options *o)
 {
 	pb_show_plain(fd_sigacts, PB_SIGACT);
diff --git a/include/crtools.h b/include/crtools.h
index ee90839..3a58675 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -157,6 +157,7 @@ void show_fifo(int fd, struct cr_options *o);
 void show_fifo_data(int fd_pipes, struct cr_options *o);
 void show_pstree(int fd_pstree, struct cr_options *o);
 void show_sigacts(int fd_sigacts, struct cr_options *o);
+void show_siginfo(int fd, struct cr_options *o);
 void show_itimers(int fd, struct cr_options *o);
 void show_creds(int fd, struct cr_options *o);
 void show_fs(int fd, struct cr_options *o);
-- 
1.7.11.7



More information about the CRIU mailing list