Skip to content

Commit

Permalink
nds32: Only print one page of stack when die to prevent printing too …
Browse files Browse the repository at this point in the history
…much information.

It may print too much information sometimes if the stack is wrong or
too big. This patch can limit the debug information in a page of stack.

Signed-off-by: Greentime Hu <greentime@andestech.com>
  • Loading branch information
Greentime Hu committed Sep 4, 2018
1 parent 95f93ed commit 487c4b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/nds32/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ void die(const char *str, struct pt_regs *regs, int err)
pr_emerg("CPU: %i\n", smp_processor_id());
show_regs(regs);
pr_emerg("Process %s (pid: %d, stack limit = 0x%p)\n",
tsk->comm, tsk->pid, task_thread_info(tsk) + 1);
tsk->comm, tsk->pid, end_of_stack(tsk));

if (!user_mode(regs) || in_interrupt()) {
dump_mem("Stack: ", regs->sp,
THREAD_SIZE + (unsigned long)task_thread_info(tsk));
dump_mem("Stack: ", regs->sp, (regs->sp + PAGE_SIZE) & PAGE_MASK);
dump_instr(regs);
dump_stack();
}
Expand Down

0 comments on commit 487c4b2

Please sign in to comment.