[PATCH] lockdep: i386 remove multi entry backtraces
Remove CONFIG_STACK_BACKTRACE_COLS. This feature didnt work out: instead of making kernel debugging more efficient, it produces much harder to read stacktraces! Check out this trace for example: http://static.flickr.com/47/158326090_35d0129147_b_d.jpg That backtrace could have been printed much nicer as a one-entry-per-line thing, taking the same amount of screen real-estate. Plus we remove 30 lines of kernel code as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
c9ca1ba5bd
commit
f0a5c315eb
2 changed files with 9 additions and 39 deletions
|
@ -31,15 +31,6 @@ config DEBUG_STACK_USAGE
|
||||||
|
|
||||||
This option will slow down process creation somewhat.
|
This option will slow down process creation somewhat.
|
||||||
|
|
||||||
config STACK_BACKTRACE_COLS
|
|
||||||
int "Stack backtraces per line" if DEBUG_KERNEL
|
|
||||||
range 1 3
|
|
||||||
default 2
|
|
||||||
help
|
|
||||||
Selects how many stack backtrace entries per line to display.
|
|
||||||
|
|
||||||
This can save screen space when displaying traces.
|
|
||||||
|
|
||||||
comment "Page alloc debug is incompatible with Software Suspend on i386"
|
comment "Page alloc debug is incompatible with Software Suspend on i386"
|
||||||
depends on DEBUG_KERNEL && SOFTWARE_SUSPEND
|
depends on DEBUG_KERNEL && SOFTWARE_SUSPEND
|
||||||
|
|
||||||
|
|
|
@ -115,28 +115,13 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print CONFIG_STACK_BACKTRACE_COLS address/symbol entries per line.
|
* Print one address/symbol entries per line.
|
||||||
*/
|
*/
|
||||||
static inline int print_addr_and_symbol(unsigned long addr, char *log_lvl,
|
static inline void print_addr_and_symbol(unsigned long addr, char *log_lvl)
|
||||||
int printed)
|
|
||||||
{
|
{
|
||||||
if (!printed)
|
|
||||||
printk(log_lvl);
|
|
||||||
|
|
||||||
#if CONFIG_STACK_BACKTRACE_COLS == 1
|
|
||||||
printk(" [<%08lx>] ", addr);
|
printk(" [<%08lx>] ", addr);
|
||||||
#else
|
|
||||||
printk(" <%08lx> ", addr);
|
|
||||||
#endif
|
|
||||||
print_symbol("%s", addr);
|
|
||||||
|
|
||||||
printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS;
|
print_symbol("%s\n", addr);
|
||||||
if (printed)
|
|
||||||
printk(" ");
|
|
||||||
else
|
|
||||||
printk("\n");
|
|
||||||
|
|
||||||
return printed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned long print_context_stack(struct thread_info *tinfo,
|
static inline unsigned long print_context_stack(struct thread_info *tinfo,
|
||||||
|
@ -144,12 +129,11 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
|
||||||
char *log_lvl)
|
char *log_lvl)
|
||||||
{
|
{
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
int printed = 0; /* nr of entries already printed on current line */
|
|
||||||
|
|
||||||
#ifdef CONFIG_FRAME_POINTER
|
#ifdef CONFIG_FRAME_POINTER
|
||||||
while (valid_stack_ptr(tinfo, (void *)ebp)) {
|
while (valid_stack_ptr(tinfo, (void *)ebp)) {
|
||||||
addr = *(unsigned long *)(ebp + 4);
|
addr = *(unsigned long *)(ebp + 4);
|
||||||
printed = print_addr_and_symbol(addr, log_lvl, printed);
|
print_addr_and_symbol(addr, log_lvl);
|
||||||
/*
|
/*
|
||||||
* break out of recursive entries (such as
|
* break out of recursive entries (such as
|
||||||
* end_of_stack_stop_unwind_function):
|
* end_of_stack_stop_unwind_function):
|
||||||
|
@ -162,28 +146,23 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
|
||||||
while (valid_stack_ptr(tinfo, stack)) {
|
while (valid_stack_ptr(tinfo, stack)) {
|
||||||
addr = *stack++;
|
addr = *stack++;
|
||||||
if (__kernel_text_address(addr))
|
if (__kernel_text_address(addr))
|
||||||
printed = print_addr_and_symbol(addr, log_lvl, printed);
|
print_addr_and_symbol(addr, log_lvl);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (printed)
|
|
||||||
printk("\n");
|
|
||||||
|
|
||||||
return ebp;
|
return ebp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static asmlinkage int show_trace_unwind(struct unwind_frame_info *info, void *log_lvl)
|
static asmlinkage int
|
||||||
|
show_trace_unwind(struct unwind_frame_info *info, void *log_lvl)
|
||||||
{
|
{
|
||||||
int n = 0;
|
int n = 0;
|
||||||
int printed = 0; /* nr of entries already printed on current line */
|
|
||||||
|
|
||||||
while (unwind(info) == 0 && UNW_PC(info)) {
|
while (unwind(info) == 0 && UNW_PC(info)) {
|
||||||
++n;
|
n++;
|
||||||
printed = print_addr_and_symbol(UNW_PC(info), log_lvl, printed);
|
print_addr_and_symbol(UNW_PC(info), log_lvl);
|
||||||
if (arch_unw_user_mode(info))
|
if (arch_unw_user_mode(info))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (printed)
|
|
||||||
printk("\n");
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue