mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 05:48:05 +00:00
stats: Add writing-memory-image timing
Dumping memory is draining it from parasite, for pre-dump this time would be reasonably small. _Writing_ the memory would occur _after_ tasks unseize and resume. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
1b54484537
commit
094330c33b
@ -6,6 +6,7 @@ enum {
|
||||
TIME_FREEZING,
|
||||
TIME_FROZEN,
|
||||
TIME_MEMDUMP,
|
||||
TIME_MEMWRITE,
|
||||
|
||||
TIME_NR_STATS,
|
||||
};
|
||||
|
2
mem.c
2
mem.c
@ -358,6 +358,7 @@ static int __parasite_dump_pages_seized(struct parasite_ctl *ctl,
|
||||
args->off += args->nr_segs;
|
||||
}
|
||||
|
||||
timing_start(TIME_MEMWRITE);
|
||||
ret = open_page_xfer(&xfer, CR_FD_PAGEMAP, ctl->pid.virt);
|
||||
if (ret < 0)
|
||||
goto out_pp;
|
||||
@ -365,6 +366,7 @@ static int __parasite_dump_pages_seized(struct parasite_ctl *ctl,
|
||||
ret = page_xfer_dump_pages(&xfer, pp, 0);
|
||||
|
||||
xfer.close(&xfer);
|
||||
timing_stop(TIME_MEMWRITE);
|
||||
task_reset_dirty_track(ctl->pid.real);
|
||||
out_pp:
|
||||
destroy_page_pipe(pp);
|
||||
|
@ -3,6 +3,7 @@ message dump_stats_entry {
|
||||
required uint32 freezing_time = 1;
|
||||
required uint32 frozen_time = 2;
|
||||
required uint32 memdump_time = 3;
|
||||
required uint32 memwrite_time = 4;
|
||||
}
|
||||
|
||||
message stats_entry {
|
||||
|
3
stats.c
3
stats.c
@ -46,7 +46,7 @@ void timing_stop(int t)
|
||||
|
||||
void show_stats(int fd)
|
||||
{
|
||||
do_pb_show_plain(fd, PB_STATS, 1, NULL, "1.1:%u 1.2:%u 1.3:%u");
|
||||
do_pb_show_plain(fd, PB_STATS, 1, NULL, "1.1:%u 1.2:%u 1.3:%u 1.4:%u");
|
||||
}
|
||||
|
||||
static void encode_time(int t, u_int32_t *to)
|
||||
@ -68,6 +68,7 @@ void write_stats(int what)
|
||||
encode_time(TIME_FREEZING, &dstats.freezing_time);
|
||||
encode_time(TIME_FROZEN, &dstats.frozen_time);
|
||||
encode_time(TIME_MEMDUMP, &dstats.memdump_time);
|
||||
encode_time(TIME_MEMWRITE, &dstats.memwrite_time);
|
||||
|
||||
name = "dump";
|
||||
} else
|
||||
|
Loading…
x
Reference in New Issue
Block a user