Commit d60805ad authored by Robin Getz's avatar Robin Getz Committed by Mike Frysinger

Blackfin: print out the faulting insn in the trace output

Print out the faulting instruction so when people send traces as part of
bug reports, we have a better idea of what is going on.
Signed-off-by: default avatarRobin Getz <robin.getz@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent d28cff4b
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <asm/trace.h> #include <asm/trace.h>
#include <asm/fixed_code.h> #include <asm/fixed_code.h>
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/irq_handler.h>
void decode_address(char *buf, unsigned long address) void decode_address(char *buf, unsigned long address)
{ {
...@@ -260,9 +261,10 @@ static void decode_instruction(unsigned short *address) ...@@ -260,9 +261,10 @@ static void decode_instruction(unsigned short *address)
void dump_bfin_trace_buffer(void) void dump_bfin_trace_buffer(void)
{ {
#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
int tflags, i = 0; int tflags, i = 0, fault = 0;
char buf[150]; char buf[150];
unsigned short *addr; unsigned short *addr;
unsigned int cpu = raw_smp_processor_id();
#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
int j, index; int j, index;
#endif #endif
...@@ -277,8 +279,21 @@ void dump_bfin_trace_buffer(void) ...@@ -277,8 +279,21 @@ void dump_bfin_trace_buffer(void)
if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) { if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) {
for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) { for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) {
decode_address(buf, (unsigned long)bfin_read_TBUF()); addr = (unsigned short *)bfin_read_TBUF();
decode_address(buf, (unsigned long)addr);
pr_notice("%4i Target : %s\n", i, buf); pr_notice("%4i Target : %s\n", i, buf);
/* Normally, the faulting instruction doesn't go into
* the trace buffer, (since it doesn't commit), so
* we print out the fault address here
*/
if (!fault && addr == (unsigned short *)trap &&
(cpu_pda[cpu].seqstat & SEQSTAT_EXCAUSE) > VEC_EXCPT15) {
decode_address(buf, cpu_pda[cpu].icplb_fault_addr);
pr_notice(" FAULT : %s ", buf);
decode_instruction((unsigned short *)cpu_pda[cpu].icplb_fault_addr);
pr_cont("\n");
fault = 1;
}
addr = (unsigned short *)bfin_read_TBUF(); addr = (unsigned short *)bfin_read_TBUF();
decode_address(buf, (unsigned long)addr); decode_address(buf, (unsigned long)addr);
pr_notice(" Source : %s ", buf); pr_notice(" Source : %s ", buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment