diff options
| -rw-r--r-- | arch/blackfin/kernel/trace.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin/kernel/trace.c index 6e37a8765bc0..5aa0d5e4e704 100644 --- a/arch/blackfin/kernel/trace.c +++ b/arch/blackfin/kernel/trace.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <asm/trace.h> | 19 | #include <asm/trace.h> |
| 20 | #include <asm/fixed_code.h> | 20 | #include <asm/fixed_code.h> |
| 21 | #include <asm/traps.h> | 21 | #include <asm/traps.h> |
| 22 | #include <asm/irq_handler.h> | ||
| 22 | 23 | ||
| 23 | void decode_address(char *buf, unsigned long address) | 24 | void decode_address(char *buf, unsigned long address) |
| 24 | { | 25 | { |
| @@ -260,9 +261,10 @@ static void decode_instruction(unsigned short *address) | |||
| 260 | void dump_bfin_trace_buffer(void) | 261 | void dump_bfin_trace_buffer(void) |
| 261 | { | 262 | { |
| 262 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON | 263 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON |
| 263 | int tflags, i = 0; | 264 | int tflags, i = 0, fault = 0; |
| 264 | char buf[150]; | 265 | char buf[150]; |
| 265 | unsigned short *addr; | 266 | unsigned short *addr; |
| 267 | unsigned int cpu = raw_smp_processor_id(); | ||
| 266 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND | 268 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND |
| 267 | int j, index; | 269 | int j, index; |
| 268 | #endif | 270 | #endif |
| @@ -277,8 +279,21 @@ void dump_bfin_trace_buffer(void) | |||
| 277 | 279 | ||
| 278 | if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) { | 280 | if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) { |
| 279 | for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) { | 281 | for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) { |
| 280 | decode_address(buf, (unsigned long)bfin_read_TBUF()); | 282 | addr = (unsigned short *)bfin_read_TBUF(); |
| 283 | decode_address(buf, (unsigned long)addr); | ||
| 281 | pr_notice("%4i Target : %s\n", i, buf); | 284 | pr_notice("%4i Target : %s\n", i, buf); |
| 285 | /* Normally, the faulting instruction doesn't go into | ||
| 286 | * the trace buffer, (since it doesn't commit), so | ||
| 287 | * we print out the fault address here | ||
| 288 | */ | ||
| 289 | if (!fault && addr == (unsigned short *)trap && | ||
| 290 | (cpu_pda[cpu].seqstat & SEQSTAT_EXCAUSE) > VEC_EXCPT15) { | ||
| 291 | decode_address(buf, cpu_pda[cpu].icplb_fault_addr); | ||
| 292 | pr_notice(" FAULT : %s ", buf); | ||
| 293 | decode_instruction((unsigned short *)cpu_pda[cpu].icplb_fault_addr); | ||
| 294 | pr_cont("\n"); | ||
| 295 | fault = 1; | ||
| 296 | } | ||
| 282 | addr = (unsigned short *)bfin_read_TBUF(); | 297 | addr = (unsigned short *)bfin_read_TBUF(); |
| 283 | decode_address(buf, (unsigned long)addr); | 298 | decode_address(buf, (unsigned long)addr); |
| 284 | pr_notice(" Source : %s ", buf); | 299 | pr_notice(" Source : %s ", buf); |
