aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-12-06 20:14:00 -0500
committerAndi Kleen <andi@basil.nowhere.org>2006-12-06 20:14:00 -0500
commitb615ebdac97c648a2ae7d23c5a0bbb3972adf928 (patch)
treefebf50b76bd8396a80edfeec6ad88412f4515a34 /arch
parent9b483417527f2e47985856867c5716df013227c7 (diff)
[PATCH] x86: shorten lines in unwinder to be <= 80 characters
Andrew complained about > 80 character lines in the new unwinder. Fix that. Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/traps.c16
-rw-r--r--arch/x86_64/kernel/traps.c21
2 files changed, 23 insertions, 14 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index fe9c5e8e7e6f..fe81d89c50d3 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -173,6 +173,8 @@ dump_trace_unwind(struct unwind_frame_info *info, void *data)
173 return n; 173 return n;
174} 174}
175 175
176#define MSG(msg) ops->warning(data, msg)
177
176void dump_trace(struct task_struct *task, struct pt_regs *regs, 178void dump_trace(struct task_struct *task, struct pt_regs *regs,
177 unsigned long *stack, 179 unsigned long *stack,
178 struct stacktrace_ops *ops, void *data) 180 struct stacktrace_ops *ops, void *data)
@@ -191,29 +193,31 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
191 if (unwind_init_frame_info(&info, task, regs) == 0) 193 if (unwind_init_frame_info(&info, task, regs) == 0)
192 unw_ret = dump_trace_unwind(&info, &oad); 194 unw_ret = dump_trace_unwind(&info, &oad);
193 } else if (task == current) 195 } else if (task == current)
194 unw_ret = unwind_init_running(&info, dump_trace_unwind, &oad); 196 unw_ret = unwind_init_running(&info, dump_trace_unwind,
197 &oad);
195 else { 198 else {
196 if (unwind_init_blocked(&info, task) == 0) 199 if (unwind_init_blocked(&info, task) == 0)
197 unw_ret = dump_trace_unwind(&info, &oad); 200 unw_ret = dump_trace_unwind(&info, &oad);
198 } 201 }
199 if (unw_ret > 0) { 202 if (unw_ret > 0) {
200 if (call_trace == 1 && !arch_unw_user_mode(&info)) { 203 if (call_trace == 1 && !arch_unw_user_mode(&info)) {
201 ops->warning_symbol(data, "DWARF2 unwinder stuck at %s\n", 204 ops->warning_symbol(data,
205 "DWARF2 unwinder stuck at %s\n",
202 UNW_PC(&info)); 206 UNW_PC(&info));
203 if (UNW_SP(&info) >= PAGE_OFFSET) { 207 if (UNW_SP(&info) >= PAGE_OFFSET) {
204 ops->warning(data, "Leftover inexact backtrace:\n"); 208 MSG("Leftover inexact backtrace:\n");
205 stack = (void *)UNW_SP(&info); 209 stack = (void *)UNW_SP(&info);
206 if (!stack) 210 if (!stack)
207 return; 211 return;
208 ebp = UNW_FP(&info); 212 ebp = UNW_FP(&info);
209 } else 213 } else
210 ops->warning(data, "Full inexact backtrace again:\n"); 214 MSG("Full inexact backtrace again:\n");
211 } else if (call_trace >= 1) 215 } else if (call_trace >= 1)
212 return; 216 return;
213 else 217 else
214 ops->warning(data, "Full inexact backtrace again:\n"); 218 MSG("Full inexact backtrace again:\n");
215 } else 219 } else
216 ops->warning(data, "Inexact backtrace:\n"); 220 MSG("Inexact backtrace:\n");
217 } 221 }
218 if (!stack) { 222 if (!stack) {
219 unsigned long dummy; 223 unsigned long dummy;
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 0d65b22f229c..d3f43c958ca1 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -235,6 +235,8 @@ static int dump_trace_unwind(struct unwind_frame_info *info, void *context)
235 return n; 235 return n;
236} 236}
237 237
238#define MSG(txt) ops->warning(data, txt)
239
238/* 240/*
239 * x86-64 can have upto three kernel stacks: 241 * x86-64 can have upto three kernel stacks:
240 * process stack 242 * process stack
@@ -248,11 +250,12 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
248 return p > t && p < t + THREAD_SIZE - 3; 250 return p > t && p < t + THREAD_SIZE - 3;
249} 251}
250 252
251void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * stack, 253void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
254 unsigned long *stack,
252 struct stacktrace_ops *ops, void *data) 255 struct stacktrace_ops *ops, void *data)
253{ 256{
254 const unsigned cpu = smp_processor_id(); 257 const unsigned cpu = smp_processor_id();
255 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr; 258 unsigned long *irqstack_end = (unsigned long*)cpu_pda(cpu)->irqstackptr;
256 unsigned used = 0; 259 unsigned used = 0;
257 struct thread_info *tinfo; 260 struct thread_info *tinfo;
258 261
@@ -268,28 +271,30 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
268 if (unwind_init_frame_info(&info, tsk, regs) == 0) 271 if (unwind_init_frame_info(&info, tsk, regs) == 0)
269 unw_ret = dump_trace_unwind(&info, &oad); 272 unw_ret = dump_trace_unwind(&info, &oad);
270 } else if (tsk == current) 273 } else if (tsk == current)
271 unw_ret = unwind_init_running(&info, dump_trace_unwind, &oad); 274 unw_ret = unwind_init_running(&info, dump_trace_unwind,
275 &oad);
272 else { 276 else {
273 if (unwind_init_blocked(&info, tsk) == 0) 277 if (unwind_init_blocked(&info, tsk) == 0)
274 unw_ret = dump_trace_unwind(&info, &oad); 278 unw_ret = dump_trace_unwind(&info, &oad);
275 } 279 }
276 if (unw_ret > 0) { 280 if (unw_ret > 0) {
277 if (call_trace == 1 && !arch_unw_user_mode(&info)) { 281 if (call_trace == 1 && !arch_unw_user_mode(&info)) {
278 ops->warning_symbol(data, "DWARF2 unwinder stuck at %s\n", 282 ops->warning_symbol(data,
283 "DWARF2 unwinder stuck at %s\n",
279 UNW_PC(&info)); 284 UNW_PC(&info));
280 if ((long)UNW_SP(&info) < 0) { 285 if ((long)UNW_SP(&info) < 0) {
281 ops->warning(data, "Leftover inexact backtrace:\n"); 286 MSG("Leftover inexact backtrace:");
282 stack = (unsigned long *)UNW_SP(&info); 287 stack = (unsigned long *)UNW_SP(&info);
283 if (!stack) 288 if (!stack)
284 return; 289 return;
285 } else 290 } else
286 ops->warning(data, "Full inexact backtrace again:\n"); 291 MSG("Full inexact backtrace again:\n");
287 } else if (call_trace >= 1) 292 } else if (call_trace >= 1)
288 return; 293 return;
289 else 294 else
290 ops->warning(data, "Full inexact backtrace again:\n"); 295 MSG("Full inexact backtrace again:\n");
291 } else 296 } else
292 ops->warning(data, "Inexact backtrace:\n"); 297 MSG("Inexact backtrace:\n");
293 } 298 }
294 if (!stack) { 299 if (!stack) {
295 unsigned long dummy; 300 unsigned long dummy;