aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2014-10-02 03:00:42 -0400
committerVineet Gupta <vgupta@synopsys.com>2015-02-26 23:45:01 -0500
commitceed97ab4ff76cb5b1d616a810e941f8837dc440 (patch)
tree0cd12cc2c53c6e73bbfef84bf430b0705495accb
parent3a51d50f426cbb65add424baebe511dcf5ac45cc (diff)
ARC: perf: Enable generic software events
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r--arch/arc/kernel/unaligned.c2
-rw-r--r--arch/arc/mm/fault.c12
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c
index 7ff5b5c183bb..74db59b6f392 100644
--- a/arch/arc/kernel/unaligned.c
+++ b/arch/arc/kernel/unaligned.c
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/perf_event.h>
15#include <linux/ptrace.h> 16#include <linux/ptrace.h>
16#include <linux/uaccess.h> 17#include <linux/uaccess.h>
17#include <asm/disasm.h> 18#include <asm/disasm.h>
@@ -253,6 +254,7 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs,
253 } 254 }
254 } 255 }
255 256
257 perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, address);
256 return 0; 258 return 0;
257 259
258fault: 260fault:
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;