aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@fastmail.fm>2008-10-04 23:12:43 +0200
committerIngo Molnar <mingo@elte.hu>2008-10-13 10:33:42 +0200
commit2ac53721f37c79acddaf60f6ff232f56b7abddba (patch)
tree56075afcaf1245c78e66ea7489f78cc1fbd3dd55 /arch
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')
-rw-r--r--arch/x86/kernel/dumpstack_32.c17
-rw-r--r--arch/x86/kernel/dumpstack_64.c9
2 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 466d55dfeb8..517b507bc56 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,
context = (struct thread_info *)
((unsigned long)stack & (~(THREAD_SIZE - 1)));
bp = print_context_stack(context, stack, bp, ops, data, NULL);
- /*
- * Should be after the line below, but somewhere
- * in early boot context comes out corrupted and we
- * can't reference it:
- */
- if (ops->stack(data, "IRQ") < 0)
- break;
+
stack = (unsigned long *)context->previous_esp;
if (!stack)
break;
+ if (ops->stack(data, "IRQ") < 0)
+ break;
touch_nmi_watchdog();
}
}
@@ -134,6 +130,7 @@ static void print_trace_warning(void *data, char *msg)
static int print_trace_stack(void *data, char *name)
{
+ printk("%s <%s> ", (char *)data, name);
return 0;
}
@@ -142,11 +139,9 @@ static int print_trace_stack(void *data, char *name)
*/
static void print_trace_address(void *data, unsigned long addr, int reliable)
{
- printk("%s [<%08lx>] ", (char *)data, addr);
- if (!reliable)
- printk("? ");
- print_symbol("%s\n", addr);
touch_nmi_watchdog();
+ printk(data);
+ printk_address(addr, reliable);
}
static const struct stacktrace_ops print_trace_ops = {
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 361afa8864b..521c833cdc3 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -247,24 +247,29 @@ EXPORT_SYMBOL(dump_trace);
static void
print_trace_warning_symbol(void *data, char *msg, unsigned long symbol)
{
+ printk(data);
print_symbol(msg, symbol);
printk("\n");
}
static void print_trace_warning(void *data, char *msg)
{
- printk("%s\n", msg);
+ printk("%s%s\n", (char *)data, msg);
}
static int print_trace_stack(void *data, char *name)
{
- printk(" <%s> ", name);
+ printk("%s <%s> ", (char *)data, name);
return 0;
}
+/*
+ * Print one address/symbol entries per line.
+ */
static void print_trace_address(void *data, unsigned long addr, int reliable)
{
touch_nmi_watchdog();
+ printk(data);
printk_address(addr, reliable);
}