Skip to contentSkip to conversation

implement dump_stack()

PATCH New Johannes Stezenbach 1 participant 1 message May 15, 2003 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 implement dump_stack()

Hi,

dump_stack() is declared in linux/kernel.h, and exported in kernel/ksyms.c, but there is no implementation for mips. It is useful for debugging.

Patch below is for linux_2_4 branch of arch/mips, but maybe also applies for 2.5 and arch/mips64. The comment is copied from arch/i386. It is debatable whether the show_stack(0) is useful or show_trace(0) would be enough. Adjust to your liking.

Regards,
Johannes

Index: linux/arch/mips/kernel/traps.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/traps.c,v retrieving revision 1.99.2.54

arch/mips/kernel/traps.c +9 -0
diff -u -p -r1.99.2.54 traps.c
@@ -190,6 +190,15 @@ void show_trace(long *sp)
 	printk("\n");
 }
 
+/*
+ * The architecture-independent backtrace generator
+ */
+void dump_stack(void)
+{
+        show_stack(0);
+        show_trace(0);
+}
+
 void show_trace_task(struct task_struct *tsk)
 {
 	show_trace((long *)tsk->thread.reg29);