mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
stats: Protobuf file introduction introduction
We'll have one more "image" file generated by dump and (surprisingly) restore commands -- the stats one. It will contain in a single pb object all the statistics collected by dump/restore. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
e75148dc03
commit
d770f4ef23
@ -46,6 +46,7 @@ obj-y += page-pipe.o
|
||||
obj-y += page-xfer.o
|
||||
obj-y += page-read.o
|
||||
obj-y += kerndat.o
|
||||
obj-y += stats.o
|
||||
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
incdeps := y
|
||||
|
7
image.c
7
image.c
@ -13,6 +13,7 @@
|
||||
#include "mount.h"
|
||||
#include "net.h"
|
||||
#include "pstree.h"
|
||||
#include "stats.h"
|
||||
#include "protobuf.h"
|
||||
#include "protobuf/inventory.pb-c.h"
|
||||
#include "protobuf/pagemap.pb-c.h"
|
||||
@ -167,6 +168,12 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = {
|
||||
FD_ENTRY(SHM_PAGES_OLD, "pages-shmem-%ld", NULL),
|
||||
FD_ENTRY(SIGNAL, "signal-s-%d", show_siginfo), /* shared signals */
|
||||
FD_ENTRY(PSIGNAL, "signal-p-%d", show_siginfo), /* private signals */
|
||||
|
||||
[CR_FD_STATS] = {
|
||||
.fmt = "stats-%s",
|
||||
.magic = STATS_MAGIC,
|
||||
.show = show_stats,
|
||||
},
|
||||
};
|
||||
|
||||
static struct cr_fdset *alloc_cr_fdset(int nr)
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
enum {
|
||||
CR_FD_INVENTORY,
|
||||
CR_FD_STATS,
|
||||
/*
|
||||
* Task entries
|
||||
*/
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#define INVENTORY_MAGIC 0x58313116 /* Veliky Novgorod */
|
||||
#define PSTREE_MAGIC 0x50273030 /* Kyiv */
|
||||
#define STATS_MAGIC 0x57093306 /* Ostashkov */
|
||||
#define FDINFO_MAGIC 0x56213732 /* Dmitrov */
|
||||
#define PAGEMAP_MAGIC 0x56084025 /* Vladimir */
|
||||
#define SHMEM_PAGEMAP_MAGIC PAGEMAP_MAGIC
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
enum {
|
||||
PB_INVENTORY,
|
||||
PB_STATS,
|
||||
PB_FDINFO,
|
||||
PB_CORE,
|
||||
PB_MM,
|
||||
|
4
include/stats.h
Normal file
4
include/stats.h
Normal file
@ -0,0 +1,4 @@
|
||||
#ifndef __CR_STATS_H__
|
||||
#define __CR_STATS_H__
|
||||
void show_stats(int fd);
|
||||
#endif
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "protobuf.h"
|
||||
#include "protobuf/inventory.pb-c.h"
|
||||
#include "protobuf/stats.pb-c.h"
|
||||
#include "protobuf/regfile.pb-c.h"
|
||||
#include "protobuf/eventfd.pb-c.h"
|
||||
#include "protobuf/eventpoll.pb-c.h"
|
||||
@ -93,6 +94,7 @@ static struct cr_pb_message_desc cr_pb_descs[PB_MAX];
|
||||
void cr_pb_init(void)
|
||||
{
|
||||
CR_PB_DESC(INVENTORY, Inventory, inventory);
|
||||
CR_PB_DESC(STATS, Stats, stats);
|
||||
CR_PB_DESC(FDINFO, Fdinfo, fdinfo);
|
||||
CR_PB_DESC(REG_FILES, RegFile, reg_file);
|
||||
CR_PB_DESC(EVENTFD, EventfdFile, eventfd_file);
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
CFLAGS += -I$(obj)/
|
||||
|
||||
proto-obj-y += stats.o
|
||||
proto-obj-y += core.o
|
||||
proto-obj-y += core-x86.o
|
||||
proto-obj-y += core-arm.o
|
||||
|
7
protobuf/stats.proto
Normal file
7
protobuf/stats.proto
Normal file
@ -0,0 +1,7 @@
|
||||
// This one contains statistics about dump/restore process
|
||||
message dump_stats_entry {
|
||||
}
|
||||
|
||||
message stats_entry {
|
||||
optional dump_stats_entry dump = 1;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user