aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-09-11 04:29:06 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-11 04:29:56 -0400
commitbde69af2ab696eebfac9583ea1e8a46b571e317f (patch)
tree1f1d6b75c91a6e6a989251af2f3ead5908d8647b /arch/s390/mm
parent5c0b912e755caaad555eb6feefdb1124462d8f37 (diff)
[S390] Wire up page fault events for software perf counters.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/fault.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index e5e119fe03b2..1abbadd497e1 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -10,6 +10,7 @@
10 * Copyright (C) 1995 Linus Torvalds 10 * Copyright (C) 1995 Linus Torvalds
11 */ 11 */
12 12
13#include <linux/perf_counter.h>
13#include <linux/signal.h> 14#include <linux/signal.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
@@ -305,7 +306,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write)
305 * interrupts again and then search the VMAs 306 * interrupts again and then search the VMAs
306 */ 307 */
307 local_irq_enable(); 308 local_irq_enable();
308 309 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
309 down_read(&mm->mmap_sem); 310 down_read(&mm->mmap_sem);
310 311
311 si_code = SEGV_MAPERR; 312 si_code = SEGV_MAPERR;
@@ -363,11 +364,15 @@ good_area:
363 } 364 }
364 BUG(); 365 BUG();
365 } 366 }
366 if (fault & VM_FAULT_MAJOR) 367 if (fault & VM_FAULT_MAJOR) {
367 tsk->maj_flt++; 368 tsk->maj_flt++;
368 else 369 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
370 regs, address);
371 } else {
369 tsk->min_flt++; 372 tsk->min_flt++;
370 373 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
374 regs, address);
375 }
371 up_read(&mm->mmap_sem); 376 up_read(&mm->mmap_sem);
372 /* 377 /*
373 * The instruction that caused the program check will 378 * The instruction that caused the program check will