mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
determine time to load a checkpoint
This commit is contained in:
parent
b8982a225a
commit
99af5378d9
1 changed files with 11 additions and 0 deletions
|
@ -434,6 +434,10 @@ static int load_checkpoint(uint8_t* mem, char* path)
|
|||
size_t location;
|
||||
size_t paddr = elf_entry;
|
||||
int ret;
|
||||
struct timeval begin, end;
|
||||
|
||||
if (verbose)
|
||||
gettimeofday(&begin, NULL);
|
||||
|
||||
if (!klog)
|
||||
klog = mem+paddr+0x5000-GUEST_OFFSET;
|
||||
|
@ -500,6 +504,13 @@ static int load_checkpoint(uint8_t* mem, char* path)
|
|||
fclose(f);
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
gettimeofday(&end, NULL);
|
||||
size_t msec = (end.tv_sec - begin.tv_sec) * 1000;
|
||||
msec += (end.tv_usec - begin.tv_usec) / 1000;
|
||||
fprintf(stderr, "Load checkpoint %u in %zd ms\n", no_checkpoint, msec);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue