summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/traps.c
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2011-03-16 19:04:59 -0400
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2011-03-16 19:04:59 -0400
commitb6fe057e20fd792a5a6e16b48451de6cc6938c2b (patch)
tree99370d97ea96b3339ff7b4709d9f2774e25f9802 /arch/powerpc/kernel/traps.c
parentab1e23d27640b08b12d68f55add7a5314c6bc14b (diff)
lttng-instrumentation/lttng-instrumentation-powerpc
LTTng instrumentation Powerpc Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r--arch/powerpc/kernel/traps.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index d002c253fc0..62ae8cad792 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -35,6 +35,7 @@
#include <linux/kdebug.h>
#include <linux/debugfs.h>
#include <linux/ltt-core.h>
+#include <trace/trap.h>
#include <asm/emulated_ops.h>
#include <asm/pgtable.h>
@@ -76,6 +77,12 @@ EXPORT_SYMBOL(__debugger_fault_handler);
#endif
/*
+ * Also used in time.c and fault.c.
+ */
+DEFINE_TRACE(trap_entry);
+DEFINE_TRACE(trap_exit);
+
+/*
* Trap & Exception support
*/
@@ -209,11 +216,14 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
addr, regs->nip, regs->link, code);
}
+ trace_trap_entry(regs, regs->trap);
+
memset(&info, 0, sizeof(info));
info.si_signo = signr;
info.si_code = code;
info.si_addr = (void __user *) addr;
force_sig_info(signr, &info, current);
+ trace_trap_exit();
}
#ifdef CONFIG_PPC64
@@ -1092,7 +1102,9 @@ void performance_monitor_exception(struct pt_regs *regs)
{
__get_cpu_var(irq_stat).pmu_irqs++;
+ trace_trap_entry(regs, regs->trap);
perf_irq(regs);
+ trace_trap_exit();
}
#ifdef CONFIG_8xx
@@ -1313,12 +1325,14 @@ void altivec_assist_exception(struct pt_regs *regs)
/* got an error reading the instruction */
_exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip);
} else {
+ trace_trap_entry(regs, regs->trap);
/* didn't recognize the instruction */
/* XXX quick hack for now: set the non-Java bit in the VSCR */
if (printk_ratelimit())
printk(KERN_ERR "Unrecognized altivec instruction "
"in %s at %lx\n", current->comm, regs->nip);
current->thread.vscr.u[3] |= 0x10000;
+ trace_trap_exit();
}
}
#endif /* CONFIG_ALTIVEC */