Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xtensa: count software page fault perf events

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

+7
+7
arch/xtensa/mm/fault.c
··· 15 15 #include <linux/mm.h> 16 16 #include <linux/module.h> 17 17 #include <linux/hardirq.h> 18 + #include <linux/perf_event.h> 18 19 #include <linux/uaccess.h> 19 20 #include <asm/mmu_context.h> 20 21 #include <asm/cacheflush.h> ··· 143 142 } 144 143 145 144 up_read(&mm->mmap_sem); 145 + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); 146 + if (flags & VM_FAULT_MAJOR) 147 + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address); 148 + else if (flags & VM_FAULT_MINOR) 149 + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address); 150 + 146 151 return; 147 152 148 153 /* Something tried to access memory that isn't in our memory map..