diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-03-13 12:21:34 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-06 09:29:40 +0200 |
commit | ac17dc8e58f3069ea895cfff963adf98ff3cf6b2 (patch) | |
tree | fe07b13dd100fd1f650d8437296f5c6908e9adea /arch | |
parent | 7dd1fcc258b65da718f01e4684a7b9244501a9fb (diff) | |
download | kernel-crypto-ac17dc8e58f3069ea895cfff963adf98ff3cf6b2.tar.gz kernel-crypto-ac17dc8e58f3069ea895cfff963adf98ff3cf6b2.tar.xz kernel-crypto-ac17dc8e58f3069ea895cfff963adf98ff3cf6b2.zip |
perf_counter: provide major/minor page fault software events
Provide separate sw counters for major and minor page faults.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/mm/fault.c | 5 | ||||
-rw-r--r-- | arch/x86/mm/fault.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index eda5b0ca4af..17bbf6f91fb 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -312,6 +312,7 @@ good_area: } if (ret & VM_FAULT_MAJOR) { current->maj_flt++; + perf_swcounter_event(PERF_COUNT_PAGE_FAULTS_MAJ, 1, 0, regs); #ifdef CONFIG_PPC_SMLPAR if (firmware_has_feature(FW_FEATURE_CMO)) { preempt_disable(); @@ -319,8 +320,10 @@ good_area: preempt_enable(); } #endif - } else + } else { current->min_flt++; + perf_swcounter_event(PERF_COUNT_PAGE_FAULTS_MIN, 1, 0, regs); + } up_read(&mm->mmap_sem); return 0; diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index c8725752b6c..f2d3324d921 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -1140,10 +1140,13 @@ good_area: return; } - if (fault & VM_FAULT_MAJOR) + if (fault & VM_FAULT_MAJOR) { tsk->maj_flt++; - else + perf_swcounter_event(PERF_COUNT_PAGE_FAULTS_MAJ, 1, 0, regs); + } else { tsk->min_flt++; + perf_swcounter_event(PERF_COUNT_PAGE_FAULTS_MIN, 1, 0, regs); + } check_v8086_mode(regs, address, tsk); |