diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-13 16:23:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-13 16:23:34 -0400 |
commit | 64f004a2ab68691b5a2e3db4cb460fcd31b6abc6 (patch) | |
tree | 1ecd5f72d0d5de9781d52f353f80898ac4fb8156 | |
parent | b48488d10954e0a337c41ea2e6086f274f118acf (diff) | |
parent | 6d4d1984df1ca6347414b9d8fa4783f548ee4cc8 (diff) |
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()
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_32.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 11 |
3 files changed, 19 insertions, 12 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index ab3b65639a3e..9c30acfadae2 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -25,10 +25,12 @@ unsigned int code_bytes = 64; | |||
25 | int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE; | 25 | int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE; |
26 | static int die_counter; | 26 | static int die_counter; |
27 | 27 | ||
28 | static void printk_stack_address(unsigned long address, int reliable) | 28 | static void printk_stack_address(unsigned long address, int reliable, |
29 | void *data) | ||
29 | { | 30 | { |
30 | pr_cont(" [<%p>] %s%pB\n", | 31 | printk("%s [<%p>] %s%pB\n", |
31 | (void *)address, reliable ? "" : "? ", (void *)address); | 32 | (char *)data, (void *)address, reliable ? "" : "? ", |
33 | (void *)address); | ||
32 | } | 34 | } |
33 | 35 | ||
34 | void printk_address(unsigned long address) | 36 | void printk_address(unsigned long address) |
@@ -155,8 +157,7 @@ static int print_trace_stack(void *data, char *name) | |||
155 | static void print_trace_address(void *data, unsigned long addr, int reliable) | 157 | static void print_trace_address(void *data, unsigned long addr, int reliable) |
156 | { | 158 | { |
157 | touch_nmi_watchdog(); | 159 | touch_nmi_watchdog(); |
158 | printk(data); | 160 | printk_stack_address(addr, reliable, data); |
159 | printk_stack_address(addr, reliable); | ||
160 | } | 161 | } |
161 | 162 | ||
162 | static const struct stacktrace_ops print_trace_ops = { | 163 | static const struct stacktrace_ops print_trace_ops = { |
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 39891ff50d03..464ffd69b92e 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
@@ -108,9 +108,12 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
108 | for (i = 0; i < kstack_depth_to_print; i++) { | 108 | for (i = 0; i < kstack_depth_to_print; i++) { |
109 | if (kstack_end(stack)) | 109 | if (kstack_end(stack)) |
110 | break; | 110 | break; |
111 | if (i && ((i % STACKSLOTS_PER_LINE) == 0)) | 111 | if ((i % STACKSLOTS_PER_LINE) == 0) { |
112 | pr_cont("\n"); | 112 | if (i != 0) |
113 | pr_cont(" %08lx", *stack++); | 113 | pr_cont("\n"); |
114 | printk("%s %08lx", log_lvl, *stack++); | ||
115 | } else | ||
116 | pr_cont(" %08lx", *stack++); | ||
114 | touch_nmi_watchdog(); | 117 | touch_nmi_watchdog(); |
115 | } | 118 | } |
116 | pr_cont("\n"); | 119 | pr_cont("\n"); |
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index ff86f19b5758..5f1c6266eb30 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
@@ -280,12 +280,15 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
280 | pr_cont(" <EOI> "); | 280 | pr_cont(" <EOI> "); |
281 | } | 281 | } |
282 | } else { | 282 | } else { |
283 | if (((long) stack & (THREAD_SIZE-1)) == 0) | 283 | if (kstack_end(stack)) |
284 | break; | 284 | break; |
285 | } | 285 | } |
286 | if (i && ((i % STACKSLOTS_PER_LINE) == 0)) | 286 | if ((i % STACKSLOTS_PER_LINE) == 0) { |
287 | pr_cont("\n"); | 287 | if (i != 0) |
288 | pr_cont(" %016lx", *stack++); | 288 | pr_cont("\n"); |
289 | printk("%s %016lx", log_lvl, *stack++); | ||
290 | } else | ||
291 | pr_cont(" %016lx", *stack++); | ||
289 | touch_nmi_watchdog(); | 292 | touch_nmi_watchdog(); |
290 | } | 293 | } |
291 | preempt_enable(); | 294 | preempt_enable(); |