2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

tcp: Show tcp queues contents when requested

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2013-09-19 12:16:07 +04:00
parent 008d3a9898
commit 360c1c13b2
3 changed files with 15 additions and 1 deletions

View File

@ -23,6 +23,7 @@
#include "uts_ns.h"
#include "ipc_ns.h"
#include "pstree.h"
#include "cr-show.h"
#include "protobuf.h"
#include "protobuf/pstree.pb-c.h"
@ -300,7 +301,7 @@ static struct show_image_info show_infos[] = {
SHOW_PLAIN(RLIMIT),
SHOW_PLAIN(TUNFILE),
{ TCP_STREAM_MAGIC, PB_TCP_STREAM, true, NULL, "1:%u 2:%u 3:%u 4:%u", },
{ TCP_STREAM_MAGIC, PB_TCP_STREAM, true, show_tcp_stream, "1:%u 2:%u 3:%u 4:%u", },
{ STATS_MAGIC, PB_STATS, true, NULL, "1.1:%u 1.2:%u 1.3:%u 1.4:%u 1.5:%Lu 1.6:%Lu 1.7:%Lu", },
{ FDINFO_MAGIC, PB_FDINFO, false, NULL, "flags:%#o fd:%d", },
{ UNIXSK_MAGIC, PB_UNIX_SK, false, NULL, "1:%#x 2:%#x 3:%d 4:%d 5:%d 6:%d 7:%d 8:%#x 11:S", },

View File

@ -16,4 +16,5 @@ extern void ipc_shm_handler(int fd, void *obj);
extern void ipc_msg_handler(int fd, void *obj);
extern void ipc_sem_handler(int fd, void *obj);
extern int cr_parse_fd(int fd, u32 magic);
extern void show_tcp_stream(int fd, void *obj);
#endif /* __CR_SHOW_H__ */

View File

@ -20,6 +20,7 @@
#include "namespaces.h"
#include "xmalloc.h"
#include "config.h"
#include "cr-show.h"
#include "protobuf.h"
#include "protobuf/tcp-stream.pb-c.h"
@ -635,3 +636,14 @@ out:
return ret;
}
void show_tcp_stream(int fd, void *obj)
{
TcpStreamEntry *e = obj;
if (opts.show_pages_content) {
pr_msg("In-queue:");
print_image_data(fd, e->inq_len, 1);
pr_msg("Out-queue:");
print_image_data(fd, e->outq_len, 1);
}
}