|
@@ -16,6 +16,7 @@
|
|
#include <linux/mm.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
|
|
+#include <linux/perf_event.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/kprobes.h>
|
|
#include <linux/kprobes.h>
|
|
#include <linux/kdebug.h>
|
|
#include <linux/kdebug.h>
|
|
@@ -296,6 +297,8 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
|
|
if (in_atomic() || !mm)
|
|
if (in_atomic() || !mm)
|
|
goto intr_or_no_mm;
|
|
goto intr_or_no_mm;
|
|
|
|
|
|
|
|
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
|
|
|
|
+
|
|
if (!down_read_trylock(&mm->mmap_sem)) {
|
|
if (!down_read_trylock(&mm->mmap_sem)) {
|
|
if ((regs->tstate & TSTATE_PRIV) &&
|
|
if ((regs->tstate & TSTATE_PRIV) &&
|
|
!search_exception_tables(regs->tpc)) {
|
|
!search_exception_tables(regs->tpc)) {
|
|
@@ -400,11 +403,15 @@ good_area:
|
|
goto do_sigbus;
|
|
goto do_sigbus;
|
|
BUG();
|
|
BUG();
|
|
}
|
|
}
|
|
- if (fault & VM_FAULT_MAJOR)
|
|
|
|
|
|
+ if (fault & VM_FAULT_MAJOR) {
|
|
current->maj_flt++;
|
|
current->maj_flt++;
|
|
- else
|
|
|
|
|
|
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
|
|
|
|
+ regs, address);
|
|
|
|
+ } else {
|
|
current->min_flt++;
|
|
current->min_flt++;
|
|
-
|
|
|
|
|
|
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
|
|
|
|
+ regs, address);
|
|
|
|
+ }
|
|
up_read(&mm->mmap_sem);
|
|
up_read(&mm->mmap_sem);
|
|
|
|
|
|
mm_rss = get_mm_rss(mm);
|
|
mm_rss = get_mm_rss(mm);
|