diff options
Diffstat (limited to 'arch/i386/kernel/traps.c')
-rw-r--r-- | arch/i386/kernel/traps.c | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 2b30dbf8d117..0efad8aeb41a 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -94,11 +94,6 @@ asmlinkage void spurious_interrupt_bug(void); | |||
94 | asmlinkage void machine_check(void); | 94 | asmlinkage void machine_check(void); |
95 | 95 | ||
96 | int kstack_depth_to_print = 24; | 96 | int kstack_depth_to_print = 24; |
97 | #ifdef CONFIG_STACK_UNWIND | ||
98 | static int call_trace = 1; | ||
99 | #else | ||
100 | #define call_trace (-1) | ||
101 | #endif | ||
102 | ATOMIC_NOTIFIER_HEAD(i386die_chain); | 97 | ATOMIC_NOTIFIER_HEAD(i386die_chain); |
103 | 98 | ||
104 | int register_die_notifier(struct notifier_block *nb) | 99 | int register_die_notifier(struct notifier_block *nb) |
@@ -152,33 +147,6 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, | |||
152 | return ebp; | 147 | return ebp; |
153 | } | 148 | } |
154 | 149 | ||
155 | struct ops_and_data { | ||
156 | struct stacktrace_ops *ops; | ||
157 | void *data; | ||
158 | }; | ||
159 | |||
160 | static asmlinkage int | ||
161 | dump_trace_unwind(struct unwind_frame_info *info, void *data) | ||
162 | { | ||
163 | struct ops_and_data *oad = (struct ops_and_data *)data; | ||
164 | int n = 0; | ||
165 | unsigned long sp = UNW_SP(info); | ||
166 | |||
167 | if (arch_unw_user_mode(info)) | ||
168 | return -1; | ||
169 | while (unwind(info) == 0 && UNW_PC(info)) { | ||
170 | n++; | ||
171 | oad->ops->address(oad->data, UNW_PC(info)); | ||
172 | if (arch_unw_user_mode(info)) | ||
173 | break; | ||
174 | if ((sp & ~(PAGE_SIZE - 1)) == (UNW_SP(info) & ~(PAGE_SIZE - 1)) | ||
175 | && sp > UNW_SP(info)) | ||
176 | break; | ||
177 | sp = UNW_SP(info); | ||
178 | } | ||
179 | return n; | ||
180 | } | ||
181 | |||
182 | #define MSG(msg) ops->warning(data, msg) | 150 | #define MSG(msg) ops->warning(data, msg) |
183 | 151 | ||
184 | void dump_trace(struct task_struct *task, struct pt_regs *regs, | 152 | void dump_trace(struct task_struct *task, struct pt_regs *regs, |
@@ -190,41 +158,6 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
190 | if (!task) | 158 | if (!task) |
191 | task = current; | 159 | task = current; |
192 | 160 | ||
193 | if (call_trace >= 0) { | ||
194 | int unw_ret = 0; | ||
195 | struct unwind_frame_info info; | ||
196 | struct ops_and_data oad = { .ops = ops, .data = data }; | ||
197 | |||
198 | if (regs) { | ||
199 | if (unwind_init_frame_info(&info, task, regs) == 0) | ||
200 | unw_ret = dump_trace_unwind(&info, &oad); | ||
201 | } else if (task == current) | ||
202 | unw_ret = unwind_init_running(&info, dump_trace_unwind, | ||
203 | &oad); | ||
204 | else { | ||
205 | if (unwind_init_blocked(&info, task) == 0) | ||
206 | unw_ret = dump_trace_unwind(&info, &oad); | ||
207 | } | ||
208 | if (unw_ret > 0) { | ||
209 | if (call_trace == 1 && !arch_unw_user_mode(&info)) { | ||
210 | ops->warning_symbol(data, | ||
211 | "DWARF2 unwinder stuck at %s", | ||
212 | UNW_PC(&info)); | ||
213 | if (UNW_SP(&info) >= PAGE_OFFSET) { | ||
214 | MSG("Leftover inexact backtrace:"); | ||
215 | stack = (void *)UNW_SP(&info); | ||
216 | if (!stack) | ||
217 | return; | ||
218 | ebp = UNW_FP(&info); | ||
219 | } else | ||
220 | MSG("Full inexact backtrace again:"); | ||
221 | } else if (call_trace >= 1) | ||
222 | return; | ||
223 | else | ||
224 | MSG("Full inexact backtrace again:"); | ||
225 | } else | ||
226 | MSG("Inexact backtrace:"); | ||
227 | } | ||
228 | if (!stack) { | 161 | if (!stack) { |
229 | unsigned long dummy; | 162 | unsigned long dummy; |
230 | stack = &dummy; | 163 | stack = &dummy; |
@@ -1258,19 +1191,3 @@ static int __init kstack_setup(char *s) | |||
1258 | return 1; | 1191 | return 1; |
1259 | } | 1192 | } |
1260 | __setup("kstack=", kstack_setup); | 1193 | __setup("kstack=", kstack_setup); |
1261 | |||
1262 | #ifdef CONFIG_STACK_UNWIND | ||
1263 | static int __init call_trace_setup(char *s) | ||
1264 | { | ||
1265 | if (strcmp(s, "old") == 0) | ||
1266 | call_trace = -1; | ||
1267 | else if (strcmp(s, "both") == 0) | ||
1268 | call_trace = 0; | ||
1269 | else if (strcmp(s, "newfallback") == 0) | ||
1270 | call_trace = 1; | ||
1271 | else if (strcmp(s, "new") == 2) | ||
1272 | call_trace = 2; | ||
1273 | return 1; | ||
1274 | } | ||
1275 | __setup("call_trace=", call_trace_setup); | ||
1276 | #endif | ||