Commit 9a95e2f1 authored by Robin Getz's avatar Robin Getz Committed by Mike Frysinger

Blackfin: make hardware trace output a little more useful

Decode the vast majority of insns that appear in the trace buffer to get a
better idea of what's going on at a glance.
Signed-off-by: default avatarRobin Getz <robin.getz@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent d60805ad
......@@ -25,10 +25,10 @@ extern unsigned long trace_buff_offset;
extern unsigned long software_trace_buff[];
#if defined(CONFIG_DEBUG_VERBOSE)
extern void decode_address(char *buf, unsigned long address);
extern bool get_instruction(unsigned short *val, unsigned short *address);
extern bool get_instruction(unsigned int *val, unsigned short *address);
#else
#define decode_address(buf, address)
#define get_instruction(val, address) 0
static inline void decode_address(char *buf, unsigned long address) { }
static inline bool get_instruction(unsigned int *val, unsigned short *address) { return false; }
#endif
/* Trace Macros for C files */
......
......@@ -18,21 +18,14 @@
*/
static bool is_bfin_call(unsigned short *addr)
{
unsigned short opcode = 0, *ins_addr;
ins_addr = (unsigned short *)addr;
unsigned int opcode;
if (!get_instruction(&opcode, ins_addr))
if (!get_instruction(&opcode, addr))
return false;
if ((opcode >= 0x0060 && opcode <= 0x0067) ||
(opcode >= 0x0070 && opcode <= 0x0077))
return true;
ins_addr--;
if (!get_instruction(&opcode, ins_addr))
return false;
if (opcode >= 0xE300 && opcode <= 0xE3FF)
(opcode >= 0x0070 && opcode <= 0x0077) ||
(opcode >= 0xE3000000 && opcode <= 0xE3FFFFFF))
return true;
return false;
......
This diff is collapsed.
......@@ -546,7 +546,7 @@ void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
#ifdef CONFIG_BUG
int is_valid_bugaddr(unsigned long addr)
{
unsigned short opcode;
unsigned int opcode;
if (!get_instruction(&opcode, (unsigned short *)addr))
return 0;
......
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