aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-06-24 13:49:03 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-06-24 13:49:03 -0400
commit163b2f0ba93e9298b3d5fff2337d860c3872ec60 (patch)
tree5020447e3146a58f5f7b3b63de2b0610a3fa2e59 /arch/sh
parent7433ab770327b471399f7b5baacad78e160b5393 (diff)
sh64: Hook up page fault events for software perf counters.
sh64 can use these as well, so tie them up there as well. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/mm/tlbflush_64.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index fcbb6e135cef..3ce40ea34824 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2000, 2001 Paolo Alberelli 4 * Copyright (C) 2000, 2001 Paolo Alberelli
5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes) 5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes)
6 * Copyright (C) 2003 Paul Mundt 6 * Copyright (C) 2003 - 2009 Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -20,6 +20,7 @@
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/perf_counter.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/io.h> 26#include <asm/io.h>
@@ -115,6 +116,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
115 /* Not an IO address, so reenable interrupts */ 116 /* Not an IO address, so reenable interrupts */
116 local_irq_enable(); 117 local_irq_enable();
117 118
119 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
120
118 /* 121 /*
119 * If we're in an interrupt or have no user 122 * If we're in an interrupt or have no user
120 * context, we must not take the fault.. 123 * context, we must not take the fault..
@@ -195,10 +198,16 @@ survive:
195 goto do_sigbus; 198 goto do_sigbus;
196 BUG(); 199 BUG();
197 } 200 }
198 if (fault & VM_FAULT_MAJOR) 201
202 if (fault & VM_FAULT_MAJOR) {
199 tsk->maj_flt++; 203 tsk->maj_flt++;
200 else 204 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
205 regs, address);
206 } else {
201 tsk->min_flt++; 207 tsk->min_flt++;
208 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
209 regs, address);
210 }
202 211
203 /* If we get here, the page fault has been handled. Do the TLB refill 212 /* If we get here, the page fault has been handled. Do the TLB refill
204 now from the newly-setup PTE, to avoid having to fault again right 213 now from the newly-setup PTE, to avoid having to fault again right