aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/dumpstack_32.c
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@fastmail.fm>2008-10-04 17:12:43 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-13 04:33:42 -0400
commit2ac53721f37c79acddaf60f6ff232f56b7abddba (patch)
tree56075afcaf1245c78e66ea7489f78cc1fbd3dd55 /arch/x86/kernel/dumpstack_32.c
parent3a18512db00e0eedca86e3db4d2e81f8fe0b1774 (diff)
dumptrace: x86: consistently include loglevel, print stack switch
- i386 and x86_64: always printk the 'data' parameter - i386: announce stack switch (irq -> normal) - i386: check if there is a stack switch before announcing it There is a warning that 'context' might come out corrupt in early boot. If this is true it should be fixed, not worked around. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/dumpstack_32.c')
-rw-r--r--arch/x86/kernel/dumpstack_32.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 466d55dfeb87..517b507bc56a 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -104,16 +104,12 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
104 context = (struct thread_info *) 104 context = (struct thread_info *)
105 ((unsigned long)stack & (~(THREAD_SIZE - 1))); 105 ((unsigned long)stack & (~(THREAD_SIZE - 1)));
106 bp = print_context_stack(context, stack, bp, ops, data, NULL); 106 bp = print_context_stack(context, stack, bp, ops, data, NULL);
107 /* 107
108 * Should be after the line below, but somewhere
109 * in early boot context comes out corrupted and we
110 * can't reference it:
111 */
112 if (ops->stack(data, "IRQ") < 0)
113 break;
114 stack = (unsigned long *)context->previous_esp; 108 stack = (unsigned long *)context->previous_esp;
115 if (!stack) 109 if (!stack)
116 break; 110 break;
111 if (ops->stack(data, "IRQ") < 0)
112 break;
117 touch_nmi_watchdog(); 113 touch_nmi_watchdog();
118 } 114 }
119} 115}
@@ -134,6 +130,7 @@ static void print_trace_warning(void *data, char *msg)
134 130
135static int print_trace_stack(void *data, char *name) 131static int print_trace_stack(void *data, char *name)
136{ 132{
133 printk("%s <%s> ", (char *)data, name);
137 return 0; 134 return 0;
138} 135}
139 136
@@ -142,11 +139,9 @@ static int print_trace_stack(void *data, char *name)
142 */ 139 */
143static void print_trace_address(void *data, unsigned long addr, int reliable) 140static void print_trace_address(void *data, unsigned long addr, int reliable)
144{ 141{
145 printk("%s [<%08lx>] ", (char *)data, addr);
146 if (!reliable)
147 printk("? ");
148 print_symbol("%s\n", addr);
149 touch_nmi_watchdog(); 142 touch_nmi_watchdog();
143 printk(data);
144 printk_address(addr, reliable);
150} 145}
151 146
152static const struct stacktrace_ops print_trace_ops = { 147static const struct stacktrace_ops print_trace_ops = {