PROFILE_mmap_anon_no_contig_phys: profile ANON mmap()s that couldn't be backed by contiguous physical memory

This commit is contained in:
Balazs Gerofi
2017-02-27 13:20:36 +09:00
parent 923dc4aa11
commit d75be7228b
3 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,7 @@ struct profile_event {
enum profile_event_type {
PROFILE_page_fault = PROFILE_EVENT_MIN,
PROFILE_mpol_alloc_missed,
PROFILE_mmap_anon_no_contig_phys,
PROFILE_EVENT_MAX /* Should be the last event type */
};

View File

@ -59,6 +59,7 @@ char *profile_event_names[] =
{
"page_fault",
"mpol_alloc_missed",
"mmap_anon_no_contig_phys",
""
};

View File

@ -1242,6 +1242,9 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot,
vrflags |= VR_DEMAND_PAGING;
populated_mapping = 0;
#ifdef PROFILE_ENABLE
profile_event_add(PROFILE_mmap_anon_no_contig_phys, len);
#endif // PROFILE_ENABLE
error = zeroobj_create(&memobj);
if (error) {
ekprintf("%s: zeroobj_create failed, error: %d\n",