[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>

authored by Jan Beulich and committed by Linus Torvalds 1b2f6304 5329e13d

+12 -13
+12 -13
arch/x86_64/kernel/traps.c
··· 183 183 184 184 void show_trace(unsigned long *stack) 185 185 { 186 - unsigned long addr; 187 186 const unsigned cpu = safe_smp_processor_id(); 188 187 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr; 189 188 int i; ··· 192 193 193 194 #define HANDLE_STACK(cond) \ 194 195 do while (cond) { \ 195 - addr = *stack++; \ 196 + unsigned long addr = *stack++; \ 196 197 if (kernel_text_address(addr)) { \ 198 + if (i > 50) { \ 199 + printk("\n "); \ 200 + i = 0; \ 201 + } \ 202 + else \ 203 + i += printk(" "); \ 197 204 /* \ 198 205 * If the address is either in the text segment of the \ 199 206 * kernel, or in the region which contains vmalloc'ed \ ··· 209 204 * out the call path that was taken. \ 210 205 */ \ 211 206 i += printk_address(addr); \ 212 - if (i > 50) { \ 213 - printk("\n "); \ 214 - i = 0; \ 215 - } \ 216 - else \ 217 - i += printk(" "); \ 218 207 } \ 219 208 } while (0) 220 209 221 - for(i = 0; ; ) { 210 + for(i = 11; ; ) { 222 211 const char *id; 223 212 unsigned long *estack_end; 224 213 estack_end = in_exception_stack(cpu, (unsigned long)stack, 225 214 &used, &id); 226 215 227 216 if (estack_end) { 228 - i += printk(" <%s> ", id); 217 + i += printk(" <%s>", id); 229 218 HANDLE_STACK (stack < estack_end); 230 - i += printk(" <EOE> "); 219 + i += printk(" <EOE>"); 231 220 stack = (unsigned long *) estack_end[-2]; 232 221 continue; 233 222 } ··· 231 232 (IRQSTACKSIZE - 64) / sizeof(*irqstack); 232 233 233 234 if (stack >= irqstack && stack < irqstack_end) { 234 - i += printk(" <IRQ> "); 235 + i += printk(" <IRQ>"); 235 236 HANDLE_STACK (stack < irqstack_end); 236 237 stack = (unsigned long *) (irqstack_end[-1]); 237 238 irqstack_end = NULL; 238 - i += printk(" <EOI> "); 239 + i += printk(" <EOI>"); 239 240 continue; 240 241 } 241 242 }