aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-07-25 10:51:36 -0400
committerRalf Baechle <ralf@linux-mips.org>2006-09-27 08:37:05 -0400
commite889d78fd5775d0b466f570928f5b0f0c9f05355 (patch)
treec85ebfa9ae7fb6d72d6c1ac6f67d64fba92b1145 /arch/mips
parente7dee3cea4dcd54744cf68864784c1336a42144f (diff)
[MIPS] Rearrange show_stack, show_trace
Print call-trace in show_stack() (like on other archs). Also make show_trace() static and simplify its argument list. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/traps.c51
1 files changed, 23 insertions, 28 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 368fdb779175..c6f70467e750 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -79,6 +79,25 @@ void (*board_bind_eic_interrupt)(int irq, int regset);
79 */ 79 */
80#define MODULE_RANGE (8*1024*1024) 80#define MODULE_RANGE (8*1024*1024)
81 81
82static void show_trace(unsigned long *stack)
83{
84 const int field = 2 * sizeof(unsigned long);
85 unsigned long addr;
86
87 printk("Call Trace:");
88#ifdef CONFIG_KALLSYMS
89 printk("\n");
90#endif
91 while (!kstack_end(stack)) {
92 addr = *stack++;
93 if (__kernel_text_address(addr)) {
94 printk(" [<%0*lx>] ", field, addr);
95 print_symbol("%s\n", addr);
96 }
97 }
98 printk("\n");
99}
100
82/* 101/*
83 * This routine abuses get_user()/put_user() to reference pointers 102 * This routine abuses get_user()/put_user() to reference pointers
84 * with at least a bit of error checking ... 103 * with at least a bit of error checking ...
@@ -88,6 +107,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
88 const int field = 2 * sizeof(unsigned long); 107 const int field = 2 * sizeof(unsigned long);
89 long stackdata; 108 long stackdata;
90 int i; 109 int i;
110 unsigned long *stack;
91 111
92 if (!sp) { 112 if (!sp) {
93 if (task && task != current) 113 if (task && task != current)
@@ -95,6 +115,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
95 else 115 else
96 sp = (unsigned long *) &sp; 116 sp = (unsigned long *) &sp;
97 } 117 }
118 stack = sp;
98 119
99 printk("Stack :"); 120 printk("Stack :");
100 i = 0; 121 i = 0;
@@ -115,32 +136,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
115 i++; 136 i++;
116 } 137 }
117 printk("\n"); 138 printk("\n");
118} 139 show_trace(stack);
119
120void show_trace(struct task_struct *task, unsigned long *stack)
121{
122 const int field = 2 * sizeof(unsigned long);
123 unsigned long addr;
124
125 if (!stack) {
126 if (task && task != current)
127 stack = (unsigned long *) task->thread.reg29;
128 else
129 stack = (unsigned long *) &stack;
130 }
131
132 printk("Call Trace:");
133#ifdef CONFIG_KALLSYMS
134 printk("\n");
135#endif
136 while (!kstack_end(stack)) {
137 addr = *stack++;
138 if (__kernel_text_address(addr)) {
139 printk(" [<%0*lx>] ", field, addr);
140 print_symbol("%s\n", addr);
141 }
142 }
143 printk("\n");
144} 140}
145 141
146/* 142/*
@@ -150,7 +146,7 @@ void dump_stack(void)
150{ 146{
151 unsigned long stack; 147 unsigned long stack;
152 148
153 show_trace(current, &stack); 149 show_trace(&stack);
154} 150}
155 151
156EXPORT_SYMBOL(dump_stack); 152EXPORT_SYMBOL(dump_stack);
@@ -270,7 +266,6 @@ void show_registers(struct pt_regs *regs)
270 printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n", 266 printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
271 current->comm, current->pid, current_thread_info(), current); 267 current->comm, current->pid, current_thread_info(), current);
272 show_stack(current, (long *) regs->regs[29]); 268 show_stack(current, (long *) regs->regs[29]);
273 show_trace(current, (long *) regs->regs[29]);
274 show_code((unsigned int *) regs->cp0_epc); 269 show_code((unsigned int *) regs->cp0_epc);
275 printk("\n"); 270 printk("\n");
276} 271}