perf_counter: provide pagefault software events
We use the generic software counter infrastructure to provide page fault events. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
15dbf27cc1
commit
7dd1fcc258
@@ -27,6 +27,7 @@
|
||||
#include <linux/tty.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/perf_counter.h>
|
||||
|
||||
#include <asm-generic/sections.h>
|
||||
|
||||
@@ -1044,6 +1045,8 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
|
||||
if (unlikely(error_code & PF_RSVD))
|
||||
pgtable_bad(regs, error_code, address);
|
||||
|
||||
perf_swcounter_event(PERF_COUNT_PAGE_FAULTS, 1, 0, regs);
|
||||
|
||||
/*
|
||||
* If we're in an interrupt, have no user context or are running
|
||||
* in an atomic region then we must not take the fault:
|
||||
|
Reference in New Issue
Block a user