.. | .. |
---|
13 | 13 | #include <linux/oprofile.h> |
---|
14 | 14 | #include <linux/init.h> |
---|
15 | 15 | #include <asm/processor.h> |
---|
16 | | - |
---|
17 | | -static int __s390_backtrace(void *data, unsigned long address, int reliable) |
---|
18 | | -{ |
---|
19 | | - unsigned int *depth = data; |
---|
20 | | - |
---|
21 | | - if (*depth == 0) |
---|
22 | | - return 1; |
---|
23 | | - (*depth)--; |
---|
24 | | - oprofile_add_trace(address); |
---|
25 | | - return 0; |
---|
26 | | -} |
---|
| 16 | +#include <asm/unwind.h> |
---|
27 | 17 | |
---|
28 | 18 | static void s390_backtrace(struct pt_regs *regs, unsigned int depth) |
---|
29 | 19 | { |
---|
30 | | - if (user_mode(regs)) |
---|
31 | | - return; |
---|
32 | | - dump_trace(__s390_backtrace, &depth, NULL, regs->gprs[15]); |
---|
| 20 | + struct unwind_state state; |
---|
| 21 | + |
---|
| 22 | + unwind_for_each_frame(&state, current, regs, 0) { |
---|
| 23 | + if (depth-- == 0) |
---|
| 24 | + break; |
---|
| 25 | + oprofile_add_trace(state.ip); |
---|
| 26 | + } |
---|
33 | 27 | } |
---|
34 | 28 | |
---|
35 | 29 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
---|