aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/fault_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/mm/fault_32.c')
-rw-r--r--arch/sparc/mm/fault_32.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c
index b99f81c4906f..a3413acb8f12 100644
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
@@ -18,6 +18,7 @@
18#include <linux/signal.h> 18#include <linux/signal.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/perf_event.h>
21#include <linux/interrupt.h> 22#include <linux/interrupt.h>
22#include <linux/module.h> 23#include <linux/module.h>
23#include <linux/kdebug.h> 24#include <linux/kdebug.h>
@@ -203,6 +204,8 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
203 if (in_atomic() || !mm) 204 if (in_atomic() || !mm)
204 goto no_context; 205 goto no_context;
205 206
207 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
208
206 down_read(&mm->mmap_sem); 209 down_read(&mm->mmap_sem);
207 210
208 /* 211 /*
@@ -249,10 +252,15 @@ good_area:
249 goto do_sigbus; 252 goto do_sigbus;
250 BUG(); 253 BUG();
251 } 254 }
252 if (fault & VM_FAULT_MAJOR) 255 if (fault & VM_FAULT_MAJOR) {
253 current->maj_flt++; 256 current->maj_flt++;
254 else 257 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
258 regs, address);
259 } else {
255 current->min_flt++; 260 current->min_flt++;
261 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
262 regs, address);
263 }
256 up_read(&mm->mmap_sem); 264 up_read(&mm->mmap_sem);
257 return; 265 return;
258 266