diff options
Diffstat (limited to 'arch/x86_64/kernel/traps.c')
-rw-r--r-- | arch/x86_64/kernel/traps.c | 84 |
1 files changed, 0 insertions, 84 deletions
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 | ||