diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-15 11:43:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-15 11:47:51 -0500 |
commit | d1526e2cda64d5a1de56aef50bad9e5df14245c2 (patch) | |
tree | d7b490b1a11dd9720c9918733ca0c06e0e82cfba /arch/x86_64 | |
parent | d1998ef38a13c4e74c69df55ccd38b0440c429b2 (diff) |
Remove stack unwinder for now
It has caused more problems than it ever really solved, and is
apparently not getting cleaned up and fixed. We can put it back when
it's stable and isn't likely to make warning or bug events worse.
In the meantime, enable frame pointers for more readable stack traces.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/Makefile | 2 | ||||
-rw-r--r-- | arch/x86_64/defconfig | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/entry.S | 33 | ||||
-rw-r--r-- | arch/x86_64/kernel/traps.c | 84 | ||||
-rw-r--r-- | arch/x86_64/kernel/vmlinux.lds.S | 2 |
5 files changed, 0 insertions, 123 deletions
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index b471b8550d03..2941a915d4ef 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile | |||
@@ -45,9 +45,7 @@ cflags-kernel-$(CONFIG_REORDER) += -ffunction-sections | |||
45 | # actually it makes the kernel smaller too. | 45 | # actually it makes the kernel smaller too. |
46 | cflags-y += -fno-reorder-blocks | 46 | cflags-y += -fno-reorder-blocks |
47 | cflags-y += -Wno-sign-compare | 47 | cflags-y += -Wno-sign-compare |
48 | ifneq ($(CONFIG_UNWIND_INFO),y) | ||
49 | cflags-y += -fno-asynchronous-unwind-tables | 48 | cflags-y += -fno-asynchronous-unwind-tables |
50 | endif | ||
51 | ifneq ($(CONFIG_DEBUG_INFO),y) | 49 | ifneq ($(CONFIG_DEBUG_INFO),y) |
52 | # -fweb shrinks the kernel a bit, but the difference is very small | 50 | # -fweb shrinks the kernel a bit, but the difference is very small |
53 | # it also messes up debugging, so don't use it for now. | 51 | # it also messes up debugging, so don't use it for now. |
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig index 1a1c6a1a299b..ac80b1209fc0 100644 --- a/arch/x86_64/defconfig +++ b/arch/x86_64/defconfig | |||
@@ -1523,8 +1523,6 @@ CONFIG_DEBUG_FS=y | |||
1523 | # CONFIG_DEBUG_VM is not set | 1523 | # CONFIG_DEBUG_VM is not set |
1524 | # CONFIG_DEBUG_LIST is not set | 1524 | # CONFIG_DEBUG_LIST is not set |
1525 | # CONFIG_FRAME_POINTER is not set | 1525 | # CONFIG_FRAME_POINTER is not set |
1526 | CONFIG_UNWIND_INFO=y | ||
1527 | CONFIG_STACK_UNWIND=y | ||
1528 | # CONFIG_FORCED_INLINING is not set | 1526 | # CONFIG_FORCED_INLINING is not set |
1529 | # CONFIG_HEADERS_CHECK is not set | 1527 | # CONFIG_HEADERS_CHECK is not set |
1530 | # CONFIG_RCU_TORTURE_TEST is not set | 1528 | # CONFIG_RCU_TORTURE_TEST is not set |
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index 601d332c4b79..9f5dac64aa8f 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S | |||
@@ -1155,36 +1155,3 @@ ENTRY(call_softirq) | |||
1155 | ret | 1155 | ret |
1156 | CFI_ENDPROC | 1156 | CFI_ENDPROC |
1157 | ENDPROC(call_softirq) | 1157 | ENDPROC(call_softirq) |
1158 | |||
1159 | #ifdef CONFIG_STACK_UNWIND | ||
1160 | ENTRY(arch_unwind_init_running) | ||
1161 | CFI_STARTPROC | ||
1162 | movq %r15, R15(%rdi) | ||
1163 | movq %r14, R14(%rdi) | ||
1164 | xchgq %rsi, %rdx | ||
1165 | movq %r13, R13(%rdi) | ||
1166 | movq %r12, R12(%rdi) | ||
1167 | xorl %eax, %eax | ||
1168 | movq %rbp, RBP(%rdi) | ||
1169 | movq %rbx, RBX(%rdi) | ||
1170 | movq (%rsp), %rcx | ||
1171 | movq %rax, R11(%rdi) | ||
1172 | movq %rax, R10(%rdi) | ||
1173 | movq %rax, R9(%rdi) | ||
1174 | movq %rax, R8(%rdi) | ||
1175 | movq %rax, RAX(%rdi) | ||
1176 | movq %rax, RCX(%rdi) | ||
1177 | movq %rax, RDX(%rdi) | ||
1178 | movq %rax, RSI(%rdi) | ||
1179 | movq %rax, RDI(%rdi) | ||
1180 | movq %rax, ORIG_RAX(%rdi) | ||
1181 | movq %rcx, RIP(%rdi) | ||
1182 | leaq 8(%rsp), %rcx | ||
1183 | movq $__KERNEL_CS, CS(%rdi) | ||
1184 | movq %rax, EFLAGS(%rdi) | ||
1185 | movq %rcx, RSP(%rdi) | ||
1186 | movq $__KERNEL_DS, SS(%rdi) | ||
1187 | jmpq *%rdx | ||
1188 | CFI_ENDPROC | ||
1189 | ENDPROC(arch_unwind_init_running) | ||
1190 | #endif | ||
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index b54ccc07f379..1d9eb6db732a 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -110,11 +110,6 @@ static inline void preempt_conditional_cli(struct pt_regs *regs) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | int kstack_depth_to_print = 12; | 112 | int kstack_depth_to_print = 12; |
113 | #ifdef CONFIG_STACK_UNWIND | ||
114 | static int call_trace = 1; | ||
115 | #else | ||
116 | #define call_trace (-1) | ||
117 | #endif | ||
118 | 113 | ||
119 | #ifdef CONFIG_KALLSYMS | 114 | #ifdef CONFIG_KALLSYMS |
120 | void printk_address(unsigned long address) | 115 | void printk_address(unsigned long address) |
@@ -217,32 +212,6 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, | |||
217 | return NULL; | 212 | return NULL; |
218 | } | 213 | } |
219 | 214 | ||
220 | struct ops_and_data { | ||
221 | struct stacktrace_ops *ops; | ||
222 | void *data; | ||
223 | }; | ||
224 | |||
225 | static int dump_trace_unwind(struct unwind_frame_info *info, void *context) | ||
226 | { | ||
227 | struct ops_and_data *oad = (struct ops_and_data *)context; | ||
228 | int n = 0; | ||
229 | unsigned long sp = UNW_SP(info); | ||
230 | |||
231 | if (arch_unw_user_mode(info)) | ||
232 | return -1; | ||
233 | while (unwind(info) == 0 && UNW_PC(info)) { | ||
234 | n++; | ||
235 | oad->ops->address(oad->data, UNW_PC(info)); | ||
236 | if (arch_unw_user_mode(info)) | ||
237 | break; | ||
238 | if ((sp & ~(PAGE_SIZE - 1)) == (UNW_SP(info) & ~(PAGE_SIZE - 1)) | ||
239 | && sp > UNW_SP(info)) | ||
240 | break; | ||
241 | sp = UNW_SP(info); | ||
242 | } | ||
243 | return n; | ||
244 | } | ||
245 | |||
246 | #define MSG(txt) ops->warning(data, txt) | 215 | #define MSG(txt) ops->warning(data, txt) |
247 | 216 | ||
248 | /* | 217 | /* |
@@ -270,40 +239,6 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, | |||
270 | if (!tsk) | 239 | if (!tsk) |
271 | tsk = current; | 240 | tsk = current; |
272 | 241 | ||
273 | if (call_trace >= 0) { | ||
274 | int unw_ret = 0; | ||
275 | struct unwind_frame_info info; | ||
276 | struct ops_and_data oad = { .ops = ops, .data = data }; | ||
277 | |||
278 | if (regs) { | ||
279 | if (unwind_init_frame_info(&info, tsk, regs) == 0) | ||
280 | unw_ret = dump_trace_unwind(&info, &oad); | ||
281 | } else if (tsk == current) | ||
282 | unw_ret = unwind_init_running(&info, dump_trace_unwind, | ||
283 | &oad); | ||
284 | else { | ||
285 | if (unwind_init_blocked(&info, tsk) == 0) | ||
286 | unw_ret = dump_trace_unwind(&info, &oad); | ||
287 | } | ||
288 | if (unw_ret > 0) { | ||
289 | if (call_trace == 1 && !arch_unw_user_mode(&info)) { | ||
290 | ops->warning_symbol(data, | ||
291 | "DWARF2 unwinder stuck at %s", | ||
292 | UNW_PC(&info)); | ||
293 | if ((long)UNW_SP(&info) < 0) { | ||
294 | MSG("Leftover inexact backtrace:"); | ||
295 | stack = (unsigned long *)UNW_SP(&info); | ||
296 | if (!stack) | ||
297 | goto out; | ||
298 | } else | ||
299 | MSG("Full inexact backtrace again:"); | ||
300 | } else if (call_trace >= 1) | ||
301 | goto out; | ||
302 | else | ||
303 | MSG("Full inexact backtrace again:"); | ||
304 | } else | ||
305 | MSG("Inexact backtrace:"); | ||
306 | } | ||
307 | if (!stack) { | 242 | if (!stack) { |
308 | unsigned long dummy; | 243 | unsigned long dummy; |
309 | stack = &dummy; | 244 | stack = &dummy; |
@@ -387,7 +322,6 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, | |||
387 | tinfo = current_thread_info(); | 322 | tinfo = current_thread_info(); |
388 | HANDLE_STACK (valid_stack_ptr(tinfo, stack)); | 323 | HANDLE_STACK (valid_stack_ptr(tinfo, stack)); |
389 | #undef HANDLE_STACK | 324 | #undef HANDLE_STACK |
390 | out: | ||
391 | put_cpu(); | 325 | put_cpu(); |
392 | } | 326 | } |
393 | EXPORT_SYMBOL(dump_trace); | 327 | EXPORT_SYMBOL(dump_trace); |
@@ -1188,21 +1122,3 @@ static int __init kstack_setup(char *s) | |||
1188 | return 0; | 1122 | return 0; |
1189 | } | 1123 | } |
1190 | early_param("kstack", kstack_setup); | 1124 | early_param("kstack", kstack_setup); |
1191 | |||
1192 | #ifdef CONFIG_STACK_UNWIND | ||
1193 | static int __init call_trace_setup(char *s) | ||
1194 | { | ||
1195 | if (!s) | ||
1196 | return -EINVAL; | ||
1197 | if (strcmp(s, "old") == 0) | ||
1198 | call_trace = -1; | ||
1199 | else if (strcmp(s, "both") == 0) | ||
1200 | call_trace = 0; | ||
1201 | else if (strcmp(s, "newfallback") == 0) | ||
1202 | call_trace = 1; | ||
1203 | else if (strcmp(s, "new") == 0) | ||
1204 | call_trace = 2; | ||
1205 | return 0; | ||
1206 | } | ||
1207 | early_param("call_trace", call_trace_setup); | ||
1208 | #endif | ||
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index 514be5dd2303..1e54ddf2338d 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S | |||
@@ -221,9 +221,7 @@ SECTIONS | |||
221 | /* Sections to be discarded */ | 221 | /* Sections to be discarded */ |
222 | /DISCARD/ : { | 222 | /DISCARD/ : { |
223 | *(.exitcall.exit) | 223 | *(.exitcall.exit) |
224 | #ifndef CONFIG_UNWIND_INFO | ||
225 | *(.eh_frame) | 224 | *(.eh_frame) |
226 | #endif | ||
227 | } | 225 | } |
228 | 226 | ||
229 | STABS_DEBUG | 227 | STABS_DEBUG |