From af885de869a9d7086d50a2c250323f0bfd939fd4 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Thu, 4 Jun 2015 13:42:22 +0300 Subject: xtensa: count software page fault perf events Signed-off-by: Max Filippov --- arch/xtensa/mm/fault.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/xtensa/mm') 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.. -- cgit