Skip to content

Commit

Permalink
[S390] incomplete stack traces.
Browse files Browse the repository at this point in the history
show_stack() passes a pointer to the current stack frame to show_trace().
Because of tail call optimization the pointer doesn't point to the original
stack frame anymory and therefore traces are wrong. Don't pass the pointer
of the current stack frame to show_trace(). Instead let show_trace()
calculate the pointer on its own.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jun 29, 2006
1 parent c406abd commit 7380534
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arch/s390/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,11 @@ void show_stack(struct task_struct *task, unsigned long *sp)
unsigned long *stack;
int i;

// debugging aid: "show_stack(NULL);" prints the
// back trace for this cpu.

if (!sp)
sp = task ? (unsigned long *) task->thread.ksp : __r15;
stack = task ? (unsigned long *) task->thread.ksp : __r15;
else
stack = sp;

stack = sp;
for (i = 0; i < kstack_depth_to_print; i++) {
if (((addr_t) stack & (THREAD_SIZE-1)) == 0)
break;
Expand Down

0 comments on commit 7380534

Please sign in to comment.