From: Max Filippov Date: Thu, 4 Jun 2015 10:42:22 +0000 (+0300) Subject: xtensa: count software page fault perf events X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=af885de869a9d7086d50a2c250323f0bfd939fd4;p=linux-beck.git xtensa: count software page fault perf events Signed-off-by: Max Filippov --- diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 83a44a33cfa1..c9784c1b18d8 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -142,6 +143,12 @@ good_area: } up_read(&mm->mmap_sem); + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); + if (flags & VM_FAULT_MAJOR) + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address); + else if (flags & VM_FAULT_MINOR) + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address); + return; /* Something tried to access memory that isn't in our memory map..