mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 02:58:54 +00:00
stats: Introduce protobuf message for restore stats
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
9bb545011c
commit
729ea690ed
2 changed files with 9 additions and 0 deletions
|
|
@ -10,6 +10,10 @@ message dump_stats_entry {
|
|||
required uint64 pages_written = 7;
|
||||
}
|
||||
|
||||
message restore_stats_entry {
|
||||
}
|
||||
|
||||
message stats_entry {
|
||||
optional dump_stats_entry dump = 1;
|
||||
optional restore_stats_entry restore = 2;
|
||||
}
|
||||
|
|
|
|||
5
stats.c
5
stats.c
|
|
@ -81,6 +81,7 @@ void write_stats(int what)
|
|||
{
|
||||
StatsEntry stats = STATS_ENTRY__INIT;
|
||||
DumpStatsEntry ds_entry = DUMP_STATS_ENTRY__INIT;
|
||||
RestoreStatsEntry rs_entry = RESTORE_STATS_ENTRY__INIT;
|
||||
char *name;
|
||||
int fd;
|
||||
|
||||
|
|
@ -98,6 +99,10 @@ void write_stats(int what)
|
|||
ds_entry.pages_written = dstats->counts[CNT_PAGES_WRITTEN];
|
||||
|
||||
name = "dump";
|
||||
} else if (what == RESTORE_STATS) {
|
||||
stats.restore = &rs_entry;
|
||||
|
||||
name = "restore";
|
||||
} else
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue