提交 bde69af2 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

[S390] Wire up page fault events for software perf counters.

Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 5c0b912e
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* Copyright (C) 1995 Linus Torvalds * Copyright (C) 1995 Linus Torvalds
*/ */
#include <linux/perf_counter.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -305,7 +306,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write) ...@@ -305,7 +306,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write)
* interrupts again and then search the VMAs * interrupts again and then search the VMAs
*/ */
local_irq_enable(); local_irq_enable();
perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
down_read(&mm->mmap_sem); down_read(&mm->mmap_sem);
si_code = SEGV_MAPERR; si_code = SEGV_MAPERR;
...@@ -363,11 +364,15 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write) ...@@ -363,11 +364,15 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write)
} }
BUG(); BUG();
} }
if (fault & VM_FAULT_MAJOR) if (fault & VM_FAULT_MAJOR) {
tsk->maj_flt++; tsk->maj_flt++;
else perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
regs, address);
} else {
tsk->min_flt++; tsk->min_flt++;
perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
regs, address);
}
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
/* /*
* The instruction that caused the program check will * The instruction that caused the program check will
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册