diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-06-25 02:49:03 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-25 02:49:03 +0900 |
commit | 163b2f0ba93e9298b3d5fff2337d860c3872ec60 (patch) | |
tree | 5020447e3146a58f5f7b3b63de2b0610a3fa2e59 /arch | |
parent | 7433ab770327b471399f7b5baacad78e160b5393 (diff) | |
download | linux-163b2f0ba93e9298b3d5fff2337d860c3872ec60.tar.gz linux-163b2f0ba93e9298b3d5fff2337d860c3872ec60.tar.bz2 linux-163b2f0ba93e9298b3d5fff2337d860c3872ec60.zip |
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')
-rw-r--r-- | arch/sh/mm/tlbflush_64.c | 15 |
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 @@ * * Copyright (C) 2000, 2001 Paolo Alberelli * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes) - * Copyright (C) 2003 Paul Mundt + * Copyright (C) 2003 - 2009 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -20,6 +20,7 @@ #include <linux/mman.h> #include <linux/mm.h> #include <linux/smp.h> +#include <linux/perf_counter.h> #include <linux/interrupt.h> #include <asm/system.h> #include <asm/io.h> @@ -115,6 +116,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess, /* Not an IO address, so reenable interrupts */ local_irq_enable(); + perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address); + /* * If we're in an interrupt or have no user * context, we must not take the fault.. @@ -195,10 +198,16 @@ survive: goto do_sigbus; BUG(); } - if (fault & VM_FAULT_MAJOR) + + if (fault & VM_FAULT_MAJOR) { tsk->maj_flt++; - else + perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0, + regs, address); + } else { tsk->min_flt++; + perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0, + regs, address); + } /* If we get here, the page fault has been handled. Do the TLB refill now from the newly-setup PTE, to avoid having to fault again right |