diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2014-10-02 03:00:42 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2015-02-26 23:45:01 -0500 |
commit | ceed97ab4ff76cb5b1d616a810e941f8837dc440 (patch) | |
tree | 0cd12cc2c53c6e73bbfef84bf430b0705495accb /arch/arc/mm/fault.c | |
parent | 3a51d50f426cbb65add424baebe511dcf5ac45cc (diff) |
ARC: perf: Enable generic software events
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm/fault.c')
-rw-r--r-- | arch/arc/mm/fault.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index 563cb27e37f5..6a2e006cbcce 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/ptrace.h> | 14 | #include <linux/ptrace.h> |
15 | #include <linux/uaccess.h> | 15 | #include <linux/uaccess.h> |
16 | #include <linux/kdebug.h> | 16 | #include <linux/kdebug.h> |
17 | #include <linux/perf_event.h> | ||
17 | #include <asm/pgalloc.h> | 18 | #include <asm/pgalloc.h> |
18 | #include <asm/mmu.h> | 19 | #include <asm/mmu.h> |
19 | 20 | ||
@@ -139,13 +140,20 @@ good_area: | |||
139 | return; | 140 | return; |
140 | } | 141 | } |
141 | 142 | ||
143 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); | ||
144 | |||
142 | if (likely(!(fault & VM_FAULT_ERROR))) { | 145 | if (likely(!(fault & VM_FAULT_ERROR))) { |
143 | if (flags & FAULT_FLAG_ALLOW_RETRY) { | 146 | if (flags & FAULT_FLAG_ALLOW_RETRY) { |
144 | /* To avoid updating stats twice for retry case */ | 147 | /* To avoid updating stats twice for retry case */ |
145 | if (fault & VM_FAULT_MAJOR) | 148 | if (fault & VM_FAULT_MAJOR) { |
146 | tsk->maj_flt++; | 149 | tsk->maj_flt++; |
147 | else | 150 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, |
151 | regs, address); | ||
152 | } else { | ||
148 | tsk->min_flt++; | 153 | tsk->min_flt++; |
154 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, | ||
155 | regs, address); | ||
156 | } | ||
149 | 157 | ||
150 | if (fault & VM_FAULT_RETRY) { | 158 | if (fault & VM_FAULT_RETRY) { |
151 | flags &= ~FAULT_FLAG_ALLOW_RETRY; | 159 | flags &= ~FAULT_FLAG_ALLOW_RETRY; |