diff options
author | Steven J. Magnani <steve@digidescorp.com> | 2010-04-27 13:37:54 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-08-04 04:22:35 -0400 |
commit | ce3266c047389443d5f433d605c769e878cbe46e (patch) | |
tree | e638a255d5d0f1b000a81b512dc605b92d0b8701 /arch/microblaze/kernel/entry.S | |
parent | ba9c4f88d747836bf35c3eee36aa18d2e164f493 (diff) |
microblaze: Add stack unwinder
Implement intelligent backtracing by searching for stack frame creation,
and emitting only return addresses. Use print_hex_dump() to display the
entire binary kernel stack.
Limitation: MMU kernels are not currently able to trace beyond a system trap
(interrupt, syscall, etc.). It is the intent of this patch to provide
infrastructure that can be extended to add this capability later.
Changes from V1:
* Removed checks in find_frame_creation() that prevented location of the frame
creation instruction in heavily optimized code
* Various formatting/commenting/file location tweaks per review comments
* Dropped Kconfig option to enable STACKTRACE as something logically separate
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Diffstat (limited to 'arch/microblaze/kernel/entry.S')
-rw-r--r-- | arch/microblaze/kernel/entry.S | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index 077377a5d0c..7a19d8910e3 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S | |||
@@ -1127,3 +1127,30 @@ ENTRY(_break) | |||
1127 | 1127 | ||
1128 | syscall_table_size=(.-sys_call_table) | 1128 | syscall_table_size=(.-sys_call_table) |
1129 | 1129 | ||
1130 | type_SYSCALL: | ||
1131 | .ascii "SYSCALL\0" | ||
1132 | type_IRQ: | ||
1133 | .ascii "IRQ\0" | ||
1134 | type_IRQ_PREEMPT: | ||
1135 | .ascii "IRQ (PREEMPTED)\0" | ||
1136 | type_SYSCALL_PREEMPT: | ||
1137 | .ascii " SYSCALL (PREEMPTED)\0" | ||
1138 | |||
1139 | /* | ||
1140 | * Trap decoding for stack unwinder | ||
1141 | * Tuples are (start addr, end addr, string) | ||
1142 | * If return address lies on [start addr, end addr], | ||
1143 | * unwinder displays 'string' | ||
1144 | */ | ||
1145 | |||
1146 | .align 4 | ||
1147 | .global microblaze_trap_handlers | ||
1148 | microblaze_trap_handlers: | ||
1149 | /* Exact matches come first */ | ||
1150 | .word ret_from_trap; .word ret_from_trap ; .word type_SYSCALL | ||
1151 | .word ret_from_irq ; .word ret_from_irq ; .word type_IRQ | ||
1152 | /* Fuzzy matches go here */ | ||
1153 | .word ret_from_irq ; .word no_intr_resched ; .word type_IRQ_PREEMPT | ||
1154 | .word ret_from_trap; .word TRAP_return ; .word type_SYSCALL_PREEMPT | ||
1155 | /* End of table */ | ||
1156 | .word 0 ; .word 0 ; .word 0 | ||