summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-02-25 22:09:22 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-02-25 22:09:22 +0000
commitbc85e585c6d0fab4bde12d60964b2f25802c3163 (patch)
tree80f5fe916e3458d0676e595e3433a0313e7ba72b /arch/arm/mm
parent186f93ea1f274f4cde4a356401c1786c818ff881 (diff)
parent796d12959ad374cae8eb77faaf4243455a305433 (diff)
downloadop-kernel-dev-bc85e585c6d0fab4bde12d60964b2f25802c3163.zip
op-kernel-dev-bc85e585c6d0fab4bde12d60964b2f25802c3163.tar.gz
Merge branch 'perf' into devel
Conflicts: arch/arm/Kconfig
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/fault.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 10e0680..9d40c34 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -18,6 +18,7 @@
#include <linux/page-flags.h>
#include <linux/sched.h>
#include <linux/highmem.h>
+#include <linux/perf_event.h>
#include <asm/system.h>
#include <asm/pgtable.h>
@@ -302,6 +303,12 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
fault = __do_page_fault(mm, addr, fsr, tsk);
up_read(&mm->mmap_sem);
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, addr);
+ if (fault & VM_FAULT_MAJOR)
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0, regs, addr);
+ else if (fault & VM_FAULT_MINOR)
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0, regs, addr);
+
/*
* Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
*/
OpenPOWER on IntegriCloud