Commit 6e528bd1 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

crtools: add a callback to show signal=*.img

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 187e1617
......@@ -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);
......
......@@ -158,6 +158,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment