profile: more detailed profiling of file PFs

This commit is contained in:
Balazs Gerofi
2017-03-09 23:00:33 +09:00
parent 4c42086154
commit 746b459e7f
4 changed files with 11 additions and 0 deletions

View File

@ -231,6 +231,9 @@ static int devobj_get_page(struct memobj *memobj, off_t off, int p2align, uintpt
memobj_lock(&obj->memobj); memobj_lock(&obj->memobj);
pfn = obj->pfn_table[ix]; pfn = obj->pfn_table[ix];
#ifdef PROFILE_ENABLE
profile_event_add(PROFILE_page_fault_dev_file, PAGE_SIZE);
#endif // PROFILE_ENABLE
if (!(pfn & PFN_VALID)) { if (!(pfn & PFN_VALID)) {
memobj_unlock(&obj->memobj); memobj_unlock(&obj->memobj);

View File

@ -487,6 +487,10 @@ static int fileobj_get_page(struct memobj *memobj, off_t off,
return -ENOMEM; return -ENOMEM;
} }
#ifdef PROFILE_ENABLE
profile_event_add(PROFILE_page_fault_file, PAGE_SIZE);
#endif // PROFILE_ENABLE
mcs_rwlock_writer_lock_noirq(&obj->page_hash_locks[hash], mcs_rwlock_writer_lock_noirq(&obj->page_hash_locks[hash],
&mcs_node); &mcs_node);
page = __fileobj_page_hash_lookup(obj, hash, off); page = __fileobj_page_hash_lookup(obj, hash, off);

View File

@ -34,6 +34,8 @@ struct profile_event {
enum profile_event_type { enum profile_event_type {
PROFILE_page_fault = PROFILE_EVENT_MIN, PROFILE_page_fault = PROFILE_EVENT_MIN,
PROFILE_page_fault_anon_clr, PROFILE_page_fault_anon_clr,
PROFILE_page_fault_file,
PROFILE_page_fault_dev_file,
PROFILE_page_fault_file_clr, PROFILE_page_fault_file_clr,
PROFILE_mpol_alloc_missed, PROFILE_mpol_alloc_missed,
PROFILE_mmap_anon_contig_phys, PROFILE_mmap_anon_contig_phys,

View File

@ -59,6 +59,8 @@ char *profile_event_names[] =
{ {
"page_fault", "page_fault",
"page_fault_anon_clr_mem", "page_fault_anon_clr_mem",
"page_fault_file",
"page_fault_dev_file",
"page_fault_file_clr_mem", "page_fault_file_clr_mem",
"mpol_alloc_missed", "mpol_alloc_missed",
"mmap_anon_contig_phys", "mmap_anon_contig_phys",