[PATCH] implement dump_stack()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
diff -u -p -r1.99.2.54 traps.c
--- linux/arch/mips/kernel/traps.c	27 Apr 2003 23:34:46 -0000	1.99.2.54
+++ linux/arch/mips/kernel/traps.c	15 May 2003 15:51:38 -0000
@@ -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);


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux