diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-11 04:07:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-11 04:07:53 -0500 |
commit | 121dd5f2776522e03970916514b46e355480e538 (patch) | |
tree | 0235f760d5e40cb4982b52368e309eac00f8826d /arch/sparc/math-emu | |
parent | c658ad1b4e1520511da8323aa5e60d444cc303ed (diff) |
sparc: Add alignment and emulation fault perf events.
This mirrors commit 196f02bf900c5eb6f85d889c4f70e7cc11fda7e8
(powerpc: perf_event: Add alignment-faults and emulation-faults software events)
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/math-emu')
-rw-r--r-- | arch/sparc/math-emu/math_32.c | 3 | ||||
-rw-r--r-- | arch/sparc/math-emu/math_64.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/sparc/math-emu/math_32.c b/arch/sparc/math-emu/math_32.c index e13f65da17df..a3fccde894ec 100644 --- a/arch/sparc/math-emu/math_32.c +++ b/arch/sparc/math-emu/math_32.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #include <linux/types.h> | 67 | #include <linux/types.h> |
68 | #include <linux/sched.h> | 68 | #include <linux/sched.h> |
69 | #include <linux/mm.h> | 69 | #include <linux/mm.h> |
70 | #include <linux/perf_event.h> | ||
70 | #include <asm/uaccess.h> | 71 | #include <asm/uaccess.h> |
71 | 72 | ||
72 | #include "sfp-util_32.h" | 73 | #include "sfp-util_32.h" |
@@ -163,6 +164,8 @@ int do_mathemu(struct pt_regs *regs, struct task_struct *fpt) | |||
163 | int retcode = 0; /* assume all succeed */ | 164 | int retcode = 0; /* assume all succeed */ |
164 | unsigned long insn; | 165 | unsigned long insn; |
165 | 166 | ||
167 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0); | ||
168 | |||
166 | #ifdef DEBUG_MATHEMU | 169 | #ifdef DEBUG_MATHEMU |
167 | printk("In do_mathemu()... pc is %08lx\n", regs->pc); | 170 | printk("In do_mathemu()... pc is %08lx\n", regs->pc); |
168 | printk("fpqdepth is %ld\n", fpt->thread.fpqdepth); | 171 | printk("fpqdepth is %ld\n", fpt->thread.fpqdepth); |
diff --git a/arch/sparc/math-emu/math_64.c b/arch/sparc/math-emu/math_64.c index 6863c9bde25c..56d2c44747b8 100644 --- a/arch/sparc/math-emu/math_64.c +++ b/arch/sparc/math-emu/math_64.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/perf_event.h> | ||
14 | 15 | ||
15 | #include <asm/fpumacro.h> | 16 | #include <asm/fpumacro.h> |
16 | #include <asm/ptrace.h> | 17 | #include <asm/ptrace.h> |
@@ -183,6 +184,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f) | |||
183 | 184 | ||
184 | if (tstate & TSTATE_PRIV) | 185 | if (tstate & TSTATE_PRIV) |
185 | die_if_kernel("unfinished/unimplemented FPop from kernel", regs); | 186 | die_if_kernel("unfinished/unimplemented FPop from kernel", regs); |
187 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0); | ||
186 | if (test_thread_flag(TIF_32BIT)) | 188 | if (test_thread_flag(TIF_32BIT)) |
187 | pc = (u32)pc; | 189 | pc = (u32)pc; |
188 | if (get_user(insn, (u32 __user *) pc) != -EFAULT) { | 190 | if (get_user(insn, (u32 __user *) pc) != -EFAULT) { |