diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2015-06-04 13:42:22 +0300 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2015-08-17 07:33:26 +0300 |
commit | af885de869a9d7086d50a2c250323f0bfd939fd4 (patch) | |
tree | 4a0b6f7e09e27dcb9a45ea00482eed26679ad9c0 /arch/xtensa/mm | |
parent | ae0b7139ab49c986e798ca9a46b7ad763ea8b8ca (diff) | |
download | linux-af885de869a9d7086d50a2c250323f0bfd939fd4.tar.xz |
xtensa: count software page fault perf events
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/mm')
-rw-r--r-- | arch/xtensa/mm/fault.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 <linux/mm.h> #include <linux/module.h> #include <linux/hardirq.h> +#include <linux/perf_event.h> #include <linux/uaccess.h> #include <asm/mmu_context.h> #include <asm/cacheflush.h> @@ -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.. |