diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/ia64/kernel/stacktrace.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/ia64/kernel/stacktrace.c')
-rw-r--r-- | arch/ia64/kernel/stacktrace.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/ia64/kernel/stacktrace.c b/arch/ia64/kernel/stacktrace.c new file mode 100644 index 000000000000..5af2783a87f4 --- /dev/null +++ b/arch/ia64/kernel/stacktrace.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * arch/ia64/kernel/stacktrace.c | ||
3 | * | ||
4 | * Stack trace management functions | ||
5 | * | ||
6 | */ | ||
7 | #include <linux/sched.h> | ||
8 | #include <linux/stacktrace.h> | ||
9 | #include <linux/module.h> | ||
10 | |||
11 | static void | ||
12 | ia64_do_save_stack(struct unw_frame_info *info, void *arg) | ||
13 | { | ||
14 | struct stack_trace *trace = arg; | ||
15 | unsigned long ip; | ||
16 | int skip = trace->skip; | ||
17 | |||
18 | trace->nr_entries = 0; | ||
19 | do { | ||
20 | unw_get_ip(info, &ip); | ||
21 | if (ip == 0) | ||
22 | break; | ||
23 | if (skip == 0) { | ||
24 | trace->entries[trace->nr_entries++] = ip; | ||
25 | if (trace->nr_entries == trace->max_entries) | ||
26 | break; | ||
27 | } else | ||
28 | skip--; | ||
29 | } while (unw_unwind(info) >= 0); | ||
30 | } | ||
31 | |||
32 | /* | ||
33 | * Save stack-backtrace addresses into a stack_trace buffer. | ||
34 | */ | ||
35 | void save_stack_trace(struct stack_trace *trace) | ||
36 | { | ||
37 | unw_init_running(ia64_do_save_stack, trace); | ||
38 | } | ||
39 | EXPORT_SYMBOL(save_stack_trace); | ||