Commit dc0cf8b1 authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

[PATCH] show_stack fix

sysrq-T currently displays the same stack trace for every process.

Teach show_stack() to look in the passed task_struct first if the caller did
not pass in a stack address.
parent 8b13d89a
...@@ -123,19 +123,20 @@ void show_trace_task(struct task_struct *tsk) ...@@ -123,19 +123,20 @@ void show_trace_task(struct task_struct *tsk)
show_trace(tsk, (unsigned long *)esp); show_trace(tsk, (unsigned long *)esp);
} }
void show_stack(struct task_struct *task, unsigned long * esp) void show_stack(struct task_struct *task, unsigned long *esp)
{ {
unsigned long *stack; unsigned long *stack;
int i; int i;
// debugging aid: "show_stack(NULL);" prints the if (esp == NULL) {
// back trace for this cpu. if (task)
esp = (unsigned long*)task->thread.esp;
if(esp==NULL) else
esp=(unsigned long*)&esp; esp = (unsigned long *)&esp;
}
stack = esp; stack = esp;
for(i=0; i < kstack_depth_to_print; i++) { for(i = 0; i < kstack_depth_to_print; i++) {
if (((long) stack & (THREAD_SIZE-1)) == 0) if (((long) stack & (THREAD_SIZE-1)) == 0)
break; break;
if (i && ((i % 8) == 0)) if (i && ((i % 8) == 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment