diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 13:31:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 13:31:35 -0400 |
commit | af5329cdf51cdd208a323e521faa46800a16d2ec (patch) | |
tree | 33eac56aac120778dc04207290ad539765ff5eb6 /kernel/stacktrace.c | |
parent | 1dc60c53d36b08f361e1a2767c41196acce96d08 (diff) | |
parent | 7798ed0f57b4d137e660fbf5be1e1528e40f89ac (diff) |
Merge branch 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
generic-ipi: powerpc/generic-ipi tree build failure
stacktrace: fix build failure on sparc64
stacktrace: export save_stack_trace[_tsk]
stacktrace: fix modular build, export print_stack_trace and save_stack_trace
backtrace: replace timer with tasklet + completions
stacktrace: add saved stack traces to backtrace self-test
stacktrace: print_stack_trace() cleanup
debugging: make stacktrace independent from DEBUG_KERNEL
stacktrace: don't crash on invalid stack trace structs
Diffstat (limited to 'kernel/stacktrace.c')
-rw-r--r-- | kernel/stacktrace.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c index b71816e47a30..94b527ef1d1e 100644 --- a/kernel/stacktrace.c +++ b/kernel/stacktrace.c | |||
@@ -6,19 +6,21 @@ | |||
6 | * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> | 6 | * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> |
7 | */ | 7 | */ |
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | #include <linux/module.h> | ||
9 | #include <linux/kallsyms.h> | 10 | #include <linux/kallsyms.h> |
10 | #include <linux/stacktrace.h> | 11 | #include <linux/stacktrace.h> |
11 | 12 | ||
12 | void print_stack_trace(struct stack_trace *trace, int spaces) | 13 | void print_stack_trace(struct stack_trace *trace, int spaces) |
13 | { | 14 | { |
14 | int i, j; | 15 | int i; |
15 | 16 | ||
16 | for (i = 0; i < trace->nr_entries; i++) { | 17 | if (WARN_ON(!trace->entries)) |
17 | unsigned long ip = trace->entries[i]; | 18 | return; |
18 | 19 | ||
19 | for (j = 0; j < spaces + 1; j++) | 20 | for (i = 0; i < trace->nr_entries; i++) { |
20 | printk(" "); | 21 | printk("%*c", 1 + spaces, ' '); |
21 | print_ip_sym(ip); | 22 | print_ip_sym(trace->entries[i]); |
22 | } | 23 | } |
23 | } | 24 | } |
25 | EXPORT_SYMBOL_GPL(print_stack_trace); | ||
24 | 26 | ||