diff options
Diffstat (limited to 'arch/mips/mm/fault.c')
-rw-r--r-- | arch/mips/mm/fault.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 783ad0065fdf..137ee76a0045 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/kprobes.h> | 20 | #include <linux/kprobes.h> |
21 | #include <linux/perf_event.h> | ||
21 | 22 | ||
22 | #include <asm/branch.h> | 23 | #include <asm/branch.h> |
23 | #include <asm/mmu_context.h> | 24 | #include <asm/mmu_context.h> |
@@ -144,6 +145,7 @@ good_area: | |||
144 | * the fault. | 145 | * the fault. |
145 | */ | 146 | */ |
146 | fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); | 147 | fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); |
148 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address); | ||
147 | if (unlikely(fault & VM_FAULT_ERROR)) { | 149 | if (unlikely(fault & VM_FAULT_ERROR)) { |
148 | if (fault & VM_FAULT_OOM) | 150 | if (fault & VM_FAULT_OOM) |
149 | goto out_of_memory; | 151 | goto out_of_memory; |
@@ -151,10 +153,15 @@ good_area: | |||
151 | goto do_sigbus; | 153 | goto do_sigbus; |
152 | BUG(); | 154 | BUG(); |
153 | } | 155 | } |
154 | if (fault & VM_FAULT_MAJOR) | 156 | if (fault & VM_FAULT_MAJOR) { |
157 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, | ||
158 | 1, 0, regs, address); | ||
155 | tsk->maj_flt++; | 159 | tsk->maj_flt++; |
156 | else | 160 | } else { |
161 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, | ||
162 | 1, 0, regs, address); | ||
157 | tsk->min_flt++; | 163 | tsk->min_flt++; |
164 | } | ||
158 | 165 | ||
159 | up_read(&mm->mmap_sem); | 166 | up_read(&mm->mmap_sem); |
160 | return; | 167 | return; |