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