Linux MIPS Architecture development
 help / color / mirror / Atom feed
* show_stack, show_trace does not work for other process
@ 2004-12-10  5:12 Atsushi Nemoto
  2004-12-15 14:28 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2004-12-10  5:12 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

On kernel 2.6, SysRq-T (show_task()) can not show correct stack dump
because show_stack() ignores an 'task' argument.  Here is a patch.  I
fixed show_trace too.

--- linux-mips/arch/mips/kernel/traps.c	2004-11-29 11:23:20.000000000 +0900
+++ linux/arch/mips/kernel/traps.c	2004-12-10 14:01:09.078969122 +0900
@@ -82,7 +82,12 @@
 	long stackdata;
 	int i;
 
-	sp = sp ? sp : (unsigned long *) &sp;
+	if (!sp) {
+		if (task && task != current)
+			sp = (unsigned long *) task->thread.reg29;
+		else
+			sp = (unsigned long *) &sp;
+	}
 
 	printk("Stack :");
 	i = 0;
@@ -110,8 +115,12 @@
 	const int field = 2 * sizeof(unsigned long);
 	unsigned long addr;
 
-	if (!stack)
-		stack = (unsigned long*)&stack;
+	if (!stack) {
+		if (task && task != current)
+			stack = (unsigned long *) task->thread.reg29;
+		else
+			stack = (unsigned long *) &stack;
+	}
 
 	printk("Call Trace:");
 #ifdef CONFIG_KALLSYMS

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-12-15 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-10  5:12 show_stack, show_trace does not work for other process Atsushi Nemoto
2004-12-15 14:28 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox