PROFILE_mmap_XXX: more detailed mmap profiling

This commit is contained in:
Balazs Gerofi
2017-03-06 14:05:18 +09:00
parent d75be7228b
commit a256280118
3 changed files with 17 additions and 0 deletions

View File

@@ -1189,6 +1189,11 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot,
error = -ENODEV;
}
#endif
#ifdef PROFILE_ENABLE
if (!error) {
profile_event_add(PROFILE_mmap_regular_file, len);
}
#endif // PROFILE_ENABLE
if (error == -ESRCH) {
dkprintf("do_mmap:hit non VREG\n");
/*
@@ -1205,6 +1210,9 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot,
prot, (flags & (MAP_POPULATE | MAP_LOCKED)));
if (!error) {
#ifdef PROFILE_ENABLE
profile_event_add(PROFILE_mmap_device_file, len);
#endif // PROFILE_ENABLE
dkprintf("%s: device fd: %d off: %lu mapping at %p - %p\n",
__FUNCTION__, fd, off, addr, addr + len);
}
@@ -1253,6 +1261,9 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot,
}
}
else {
#ifdef PROFILE_ENABLE
profile_event_add(PROFILE_mmap_anon_contig_phys, len);
#endif // PROFILE_ENABLE
dkprintf("%s: 0x%x:%lu MAP_ANONYMOUS "
"allocated %d pages, p2align: %lx\n",
__FUNCTION__, addr, len, npages, p2align);