diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-03 03:24:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:27:02 -0400 |
commit | f0a5c315eb266edc608a29971bb4ff1a3025c58f (patch) | |
tree | 5cc74aa9c022ee8cdb434cb5fe0bcdc925d9c235 /arch | |
parent | c9ca1ba5bde45839cdc4f8ab93730cb68e6ee8a6 (diff) |
[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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/Kconfig.debug | 9 | ||||
-rw-r--r-- | arch/i386/kernel/traps.c | 39 |
2 files changed, 9 insertions, 39 deletions
diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug index c92191b1fb67..b20ddd04f3d8 100644 --- a/arch/i386/Kconfig.debug +++ b/arch/i386/Kconfig.debug | |||
@@ -31,15 +31,6 @@ config DEBUG_STACK_USAGE | |||
31 | 31 | ||
32 | This option will slow down process creation somewhat. | 32 | This option will slow down process creation somewhat. |
33 | 33 | ||
34 | config STACK_BACKTRACE_COLS | ||
35 | int "Stack backtraces per line" if DEBUG_KERNEL | ||
36 | range 1 3 | ||
37 | default 2 | ||
38 | help | ||
39 | Selects how many stack backtrace entries per line to display. | ||
40 | |||
41 | This can save screen space when displaying traces. | ||
42 | |||
43 | comment "Page alloc debug is incompatible with Software Suspend on i386" | 34 | comment "Page alloc debug is incompatible with Software Suspend on i386" |
44 | depends on DEBUG_KERNEL && SOFTWARE_SUSPEND | 35 | depends on DEBUG_KERNEL && SOFTWARE_SUSPEND |
45 | 36 | ||
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index e8c6086b2aa1..2bf8b55b91f8 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -115,28 +115,13 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) | |||
115 | } | 115 | } |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * Print CONFIG_STACK_BACKTRACE_COLS address/symbol entries per line. | 118 | * Print one address/symbol entries per line. |
119 | */ | 119 | */ |
120 | static inline int print_addr_and_symbol(unsigned long addr, char *log_lvl, | 120 | static inline void print_addr_and_symbol(unsigned long addr, char *log_lvl) |
121 | int printed) | ||
122 | { | 121 | { |
123 | if (!printed) | ||
124 | printk(log_lvl); | ||
125 | |||
126 | #if CONFIG_STACK_BACKTRACE_COLS == 1 | ||
127 | printk(" [<%08lx>] ", addr); | 122 | printk(" [<%08lx>] ", addr); |
128 | #else | ||
129 | printk(" <%08lx> ", addr); | ||
130 | #endif | ||
131 | print_symbol("%s", addr); | ||
132 | 123 | ||
133 | printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS; | 124 | print_symbol("%s\n", addr); |
134 | if (printed) | ||
135 | printk(" "); | ||
136 | else | ||
137 | printk("\n"); | ||
138 | |||
139 | return printed; | ||
140 | } | 125 | } |
141 | 126 | ||
142 | static inline unsigned long print_context_stack(struct thread_info *tinfo, | 127 | 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, | |||
144 | char *log_lvl) | 129 | char *log_lvl) |
145 | { | 130 | { |
146 | unsigned long addr; | 131 | unsigned long addr; |
147 | int printed = 0; /* nr of entries already printed on current line */ | ||
148 | 132 | ||
149 | #ifdef CONFIG_FRAME_POINTER | 133 | #ifdef CONFIG_FRAME_POINTER |
150 | while (valid_stack_ptr(tinfo, (void *)ebp)) { | 134 | while (valid_stack_ptr(tinfo, (void *)ebp)) { |
151 | addr = *(unsigned long *)(ebp + 4); | 135 | addr = *(unsigned long *)(ebp + 4); |
152 | printed = print_addr_and_symbol(addr, log_lvl, printed); | 136 | print_addr_and_symbol(addr, log_lvl); |
153 | /* | 137 | /* |
154 | * break out of recursive entries (such as | 138 | * break out of recursive entries (such as |
155 | * end_of_stack_stop_unwind_function): | 139 | * end_of_stack_stop_unwind_function): |
@@ -162,28 +146,23 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, | |||
162 | while (valid_stack_ptr(tinfo, stack)) { | 146 | while (valid_stack_ptr(tinfo, stack)) { |
163 | addr = *stack++; | 147 | addr = *stack++; |
164 | if (__kernel_text_address(addr)) | 148 | if (__kernel_text_address(addr)) |
165 | printed = print_addr_and_symbol(addr, log_lvl, printed); | 149 | print_addr_and_symbol(addr, log_lvl); |
166 | } | 150 | } |
167 | #endif | 151 | #endif |
168 | if (printed) | ||
169 | printk("\n"); | ||
170 | |||
171 | return ebp; | 152 | return ebp; |
172 | } | 153 | } |
173 | 154 | ||
174 | static asmlinkage int show_trace_unwind(struct unwind_frame_info *info, void *log_lvl) | 155 | static asmlinkage int |
156 | show_trace_unwind(struct unwind_frame_info *info, void *log_lvl) | ||
175 | { | 157 | { |
176 | int n = 0; | 158 | int n = 0; |
177 | int printed = 0; /* nr of entries already printed on current line */ | ||
178 | 159 | ||
179 | while (unwind(info) == 0 && UNW_PC(info)) { | 160 | while (unwind(info) == 0 && UNW_PC(info)) { |
180 | ++n; | 161 | n++; |
181 | printed = print_addr_and_symbol(UNW_PC(info), log_lvl, printed); | 162 | print_addr_and_symbol(UNW_PC(info), log_lvl); |
182 | if (arch_unw_user_mode(info)) | 163 | if (arch_unw_user_mode(info)) |
183 | break; | 164 | break; |
184 | } | 165 | } |
185 | if (printed) | ||
186 | printk("\n"); | ||
187 | return n; | 166 | return n; |
188 | } | 167 | } |
189 | 168 | ||