Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31780
b: refs/heads/master
c: f0a5c31
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jul 3, 2006
1 parent 406bfe8 commit fe4cac8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c9ca1ba5bde45839cdc4f8ab93730cb68e6ee8a6
refs/heads/master: f0a5c315eb266edc608a29971bb4ff1a3025c58f
9 changes: 0 additions & 9 deletions trunk/arch/i386/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ config DEBUG_STACK_USAGE

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"
depends on DEBUG_KERNEL && SOFTWARE_SUSPEND

Expand Down
39 changes: 9 additions & 30 deletions trunk/arch/i386/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,41 +115,25 @@ 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,
int printed)
static inline void print_addr_and_symbol(unsigned long addr, char *log_lvl)
{
if (!printed)
printk(log_lvl);

#if CONFIG_STACK_BACKTRACE_COLS == 1
printk(" [<%08lx>] ", addr);
#else
printk(" <%08lx> ", addr);
#endif
print_symbol("%s", addr);

printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS;
if (printed)
printk(" ");
else
printk("\n");

return printed;
print_symbol("%s\n", addr);
}

static inline unsigned long print_context_stack(struct thread_info *tinfo,
unsigned long *stack, unsigned long ebp,
char *log_lvl)
{
unsigned long addr;
int printed = 0; /* nr of entries already printed on current line */

#ifdef CONFIG_FRAME_POINTER
while (valid_stack_ptr(tinfo, (void *)ebp)) {
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
* end_of_stack_stop_unwind_function):
Expand All @@ -162,28 +146,23 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
while (valid_stack_ptr(tinfo, stack)) {
addr = *stack++;
if (__kernel_text_address(addr))
printed = print_addr_and_symbol(addr, log_lvl, printed);
print_addr_and_symbol(addr, log_lvl);
}
#endif
if (printed)
printk("\n");

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 printed = 0; /* nr of entries already printed on current line */

while (unwind(info) == 0 && UNW_PC(info)) {
++n;
printed = print_addr_and_symbol(UNW_PC(info), log_lvl, printed);
n++;
print_addr_and_symbol(UNW_PC(info), log_lvl);
if (arch_unw_user_mode(info))
break;
}
if (printed)
printk("\n");
return n;
}

Expand Down

0 comments on commit fe4cac8

Please sign in to comment.