Commit 64f004a2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 debug changes from Ingo Molnar:
 "Stack printing fixlets"

* 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/kernel: Use kstack_end() in dumpstack_64.c
  x86/kernel: Fix output of show_stack_log_lvl()
parents b48488d1 6d4d1984
...@@ -25,10 +25,12 @@ unsigned int code_bytes = 64; ...@@ -25,10 +25,12 @@ unsigned int code_bytes = 64;
int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE; int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE;
static int die_counter; static int die_counter;
static void printk_stack_address(unsigned long address, int reliable) static void printk_stack_address(unsigned long address, int reliable,
void *data)
{ {
pr_cont(" [<%p>] %s%pB\n", printk("%s [<%p>] %s%pB\n",
(void *)address, reliable ? "" : "? ", (void *)address); (char *)data, (void *)address, reliable ? "" : "? ",
(void *)address);
} }
void printk_address(unsigned long address) void printk_address(unsigned long address)
...@@ -155,8 +157,7 @@ static int print_trace_stack(void *data, char *name) ...@@ -155,8 +157,7 @@ static int print_trace_stack(void *data, char *name)
static void print_trace_address(void *data, unsigned long addr, int reliable) static void print_trace_address(void *data, unsigned long addr, int reliable)
{ {
touch_nmi_watchdog(); touch_nmi_watchdog();
printk(data); printk_stack_address(addr, reliable, data);
printk_stack_address(addr, reliable);
} }
static const struct stacktrace_ops print_trace_ops = { static const struct stacktrace_ops print_trace_ops = {
......
...@@ -108,9 +108,12 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, ...@@ -108,9 +108,12 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
for (i = 0; i < kstack_depth_to_print; i++) { for (i = 0; i < kstack_depth_to_print; i++) {
if (kstack_end(stack)) if (kstack_end(stack))
break; break;
if (i && ((i % STACKSLOTS_PER_LINE) == 0)) if ((i % STACKSLOTS_PER_LINE) == 0) {
pr_cont("\n"); if (i != 0)
pr_cont(" %08lx", *stack++); pr_cont("\n");
printk("%s %08lx", log_lvl, *stack++);
} else
pr_cont(" %08lx", *stack++);
touch_nmi_watchdog(); touch_nmi_watchdog();
} }
pr_cont("\n"); pr_cont("\n");
......
...@@ -280,12 +280,15 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, ...@@ -280,12 +280,15 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
pr_cont(" <EOI> "); pr_cont(" <EOI> ");
} }
} else { } else {
if (((long) stack & (THREAD_SIZE-1)) == 0) if (kstack_end(stack))
break; break;
} }
if (i && ((i % STACKSLOTS_PER_LINE) == 0)) if ((i % STACKSLOTS_PER_LINE) == 0) {
pr_cont("\n"); if (i != 0)
pr_cont(" %016lx", *stack++); pr_cont("\n");
printk("%s %016lx", log_lvl, *stack++);
} else
pr_cont(" %016lx", *stack++);
touch_nmi_watchdog(); touch_nmi_watchdog();
} }
preempt_enable(); preempt_enable();
......
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