aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2006-01-11 16:46:45 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-11 22:05:03 -0500
commit1b2f6304500930ab534a6aa3198bce0c51586206 (patch)
tree208a8544004b6b60ab75fb7037a72b1fb4a21793 /arch/x86_64
parent5329e13d0bd82e13814050eb9facb25eedde4bbc (diff)
[PATCH] x86_64: Reduce screen space needed by stack trace
Especially under Xen, where the console cannot be adjusted to more than 25 lines, it is fairly important that the information displayed during a panic is as compact as possible. Below adjustments work towards that. Signed-Off-By: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/kernel/traps.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index fcee07db3b68..d345c712c6ca 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -183,7 +183,6 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
183 183
184void show_trace(unsigned long *stack) 184void show_trace(unsigned long *stack)
185{ 185{
186 unsigned long addr;
187 const unsigned cpu = safe_smp_processor_id(); 186 const unsigned cpu = safe_smp_processor_id();
188 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr; 187 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
189 int i; 188 int i;
@@ -193,8 +192,14 @@ void show_trace(unsigned long *stack)
193 192
194#define HANDLE_STACK(cond) \ 193#define HANDLE_STACK(cond) \
195 do while (cond) { \ 194 do while (cond) { \
196 addr = *stack++; \ 195 unsigned long addr = *stack++; \
197 if (kernel_text_address(addr)) { \ 196 if (kernel_text_address(addr)) { \
197 if (i > 50) { \
198 printk("\n "); \
199 i = 0; \
200 } \
201 else \
202 i += printk(" "); \
198 /* \ 203 /* \
199 * If the address is either in the text segment of the \ 204 * If the address is either in the text segment of the \
200 * kernel, or in the region which contains vmalloc'ed \ 205 * kernel, or in the region which contains vmalloc'ed \
@@ -204,25 +209,19 @@ void show_trace(unsigned long *stack)
204 * out the call path that was taken. \ 209 * out the call path that was taken. \
205 */ \ 210 */ \
206 i += printk_address(addr); \ 211 i += printk_address(addr); \
207 if (i > 50) { \
208 printk("\n "); \
209 i = 0; \
210 } \
211 else \
212 i += printk(" "); \
213 } \ 212 } \
214 } while (0) 213 } while (0)
215 214
216 for(i = 0; ; ) { 215 for(i = 11; ; ) {
217 const char *id; 216 const char *id;
218 unsigned long *estack_end; 217 unsigned long *estack_end;
219 estack_end = in_exception_stack(cpu, (unsigned long)stack, 218 estack_end = in_exception_stack(cpu, (unsigned long)stack,
220 &used, &id); 219 &used, &id);
221 220
222 if (estack_end) { 221 if (estack_end) {
223 i += printk(" <%s> ", id); 222 i += printk(" <%s>", id);
224 HANDLE_STACK (stack < estack_end); 223 HANDLE_STACK (stack < estack_end);
225 i += printk(" <EOE> "); 224 i += printk(" <EOE>");
226 stack = (unsigned long *) estack_end[-2]; 225 stack = (unsigned long *) estack_end[-2];
227 continue; 226 continue;
228 } 227 }
@@ -232,11 +231,11 @@ void show_trace(unsigned long *stack)
232 (IRQSTACKSIZE - 64) / sizeof(*irqstack); 231 (IRQSTACKSIZE - 64) / sizeof(*irqstack);
233 232
234 if (stack >= irqstack && stack < irqstack_end) { 233 if (stack >= irqstack && stack < irqstack_end) {
235 i += printk(" <IRQ> "); 234 i += printk(" <IRQ>");
236 HANDLE_STACK (stack < irqstack_end); 235 HANDLE_STACK (stack < irqstack_end);
237 stack = (unsigned long *) (irqstack_end[-1]); 236 stack = (unsigned long *) (irqstack_end[-1]);
238 irqstack_end = NULL; 237 irqstack_end = NULL;
239 i += printk(" <EOI> "); 238 i += printk(" <EOI>");
240 continue; 239 continue;
241 } 240 }
242 } 241 }