diff options
author | Alexander van Heukelum <heukelum@fastmail.fm> | 2008-10-04 17:12:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-13 04:33:42 -0400 |
commit | 2ac53721f37c79acddaf60f6ff232f56b7abddba (patch) | |
tree | 56075afcaf1245c78e66ea7489f78cc1fbd3dd55 | |
parent | 3a18512db00e0eedca86e3db4d2e81f8fe0b1774 (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>
-rw-r--r-- | arch/x86/kernel/dumpstack_32.c | 17 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 9 |
2 files changed, 13 insertions, 13 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 | ||
135 | static int print_trace_stack(void *data, char *name) | 131 | static 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 | */ |
143 | static void print_trace_address(void *data, unsigned long addr, int reliable) | 140 | static 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 | ||
152 | static const struct stacktrace_ops print_trace_ops = { | 147 | 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 361afa8864b4..521c833cdc3b 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
@@ -247,24 +247,29 @@ EXPORT_SYMBOL(dump_trace); | |||
247 | static void | 247 | static void |
248 | print_trace_warning_symbol(void *data, char *msg, unsigned long symbol) | 248 | print_trace_warning_symbol(void *data, char *msg, unsigned long symbol) |
249 | { | 249 | { |
250 | printk(data); | ||
250 | print_symbol(msg, symbol); | 251 | print_symbol(msg, symbol); |
251 | printk("\n"); | 252 | printk("\n"); |
252 | } | 253 | } |
253 | 254 | ||
254 | static void print_trace_warning(void *data, char *msg) | 255 | static void print_trace_warning(void *data, char *msg) |
255 | { | 256 | { |
256 | printk("%s\n", msg); | 257 | printk("%s%s\n", (char *)data, msg); |
257 | } | 258 | } |
258 | 259 | ||
259 | static int print_trace_stack(void *data, char *name) | 260 | static int print_trace_stack(void *data, char *name) |
260 | { | 261 | { |
261 | printk(" <%s> ", name); | 262 | printk("%s <%s> ", (char *)data, name); |
262 | return 0; | 263 | return 0; |
263 | } | 264 | } |
264 | 265 | ||
266 | /* | ||
267 | * Print one address/symbol entries per line. | ||
268 | */ | ||
265 | static void print_trace_address(void *data, unsigned long addr, int reliable) | 269 | static void print_trace_address(void *data, unsigned long addr, int reliable) |
266 | { | 270 | { |
267 | touch_nmi_watchdog(); | 271 | touch_nmi_watchdog(); |
272 | printk(data); | ||
268 | printk_address(addr, reliable); | 273 | printk_address(addr, reliable); |
269 | } | 274 | } |
270 | 275 | ||