提交 2ac53721 编写于 作者: A Alexander van Heukelum 提交者: Ingo Molnar

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: NAlexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 3a18512d
...@@ -104,16 +104,12 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, ...@@ -104,16 +104,12 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
context = (struct thread_info *) context = (struct thread_info *)
((unsigned long)stack & (~(THREAD_SIZE - 1))); ((unsigned long)stack & (~(THREAD_SIZE - 1)));
bp = print_context_stack(context, stack, bp, ops, data, NULL); 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; stack = (unsigned long *)context->previous_esp;
if (!stack) if (!stack)
break; break;
if (ops->stack(data, "IRQ") < 0)
break;
touch_nmi_watchdog(); touch_nmi_watchdog();
} }
} }
...@@ -134,6 +130,7 @@ static void print_trace_warning(void *data, char *msg) ...@@ -134,6 +130,7 @@ static void print_trace_warning(void *data, char *msg)
static int print_trace_stack(void *data, char *name) static int print_trace_stack(void *data, char *name)
{ {
printk("%s <%s> ", (char *)data, name);
return 0; return 0;
} }
...@@ -142,11 +139,9 @@ static int print_trace_stack(void *data, char *name) ...@@ -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) 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(); touch_nmi_watchdog();
printk(data);
printk_address(addr, reliable);
} }
static const struct stacktrace_ops print_trace_ops = { static const struct stacktrace_ops print_trace_ops = {
......
...@@ -247,24 +247,29 @@ EXPORT_SYMBOL(dump_trace); ...@@ -247,24 +247,29 @@ EXPORT_SYMBOL(dump_trace);
static void static void
print_trace_warning_symbol(void *data, char *msg, unsigned long symbol) print_trace_warning_symbol(void *data, char *msg, unsigned long symbol)
{ {
printk(data);
print_symbol(msg, symbol); print_symbol(msg, symbol);
printk("\n"); printk("\n");
} }
static void print_trace_warning(void *data, char *msg) 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) static int print_trace_stack(void *data, char *name)
{ {
printk(" <%s> ", name); printk("%s <%s> ", (char *)data, name);
return 0; return 0;
} }
/*
* Print one address/symbol entries per line.
*/
static void print_trace_address(void *data, unsigned long addr, int reliable) static void print_trace_address(void *data, unsigned long addr, int reliable)
{ {
touch_nmi_watchdog(); touch_nmi_watchdog();
printk(data);
printk_address(addr, reliable); printk_address(addr, reliable);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册